Draws a data set from the HEV model of hev(): utilities from beta (and
gamma) as in rmnl() plus independent Gumbel errors with scales scale
(one per level, in level order; the base alternative's scale should be 1 to
match the estimator's normalization).
Arguments
- n
Number of cases.
- beta
A \(p \times (J-1)\) matrix: rows are the intercept and the \(p - 1\) covariates, columns the non-base alternatives (column names become their labels; the base is
"a"unlesslevelsis given).- scale
Gumbel scale parameters, one per level.
- gamma
Optional generic coefficients on alternative-specific covariates
w1,w2, ... (standard normal draws for every case and alternative). When given, the data are returned in the long layout: one row per case and alternative with columnsid,alt,chosen(0/1), thew's, thex's (and, for inflated draws ofrmnl(), thez's ands), ready forchosen ~ w1 | x1 + x2withid = "id", alt = "alt".- x
Optional data frame of case-specific covariates (
nrows) to use instead of standard normal draws.- levels
Optional labels of all \(J\) alternatives (base first).
Value
A data frame as in rmnl(); the truth in the attribute "truth".