You can also do it by specifying the rpar
arguments exactly as they appear when you run the regular mlogit()
command. So for your example:
rpar = list("A:scan.id"="n", "C:scan.id"="n", ...)
where they named list must be quoted because of the "::
" (I think, it may just be for "((
", but it works with quotes either way) -- see. This is explained in footnote 20 p. 24 of Viton, PA. "Discrete-Choice Logit Models with R" (this pdfpdf*. Also):
The specification of random parameters for the alternative-specific constants has changed from
mlogit
version 0.1-8. The old version hadrpar=c(altair='n',altbus='n',alttrain='n')
. If you get an error here, try estimating model without random parameters (like modelres4
above), and note how the mode-specific dummys are reported; then use that syntax in therpar
argument.
Also see the 1st paragraph of p.26 of the documentation (pdf) about having to list the entire name of individual specific coefficients. II had a similar problem when trying to just use scan.id but it stated working when I started putting the A:scan.id =
argument instead. I believe you can do this with your data, as long as you set panel=F
which I think is the only time the id.var=scan.id
is invoked for multiple observation on the same person. If you do in fact have a panel, then don't use that variable and use the other variables you want to simulate as normal or another distribution. I'd also recommend using halton=NA
argument if you have a large dataset as it speeds up the simulation significantly.
* Philip A. Viton (2014) Discrete Choice Logit Models with R. Materials for Ohio State City and Regional Planning 5700.