[R] error in mlogit

Achim Zeileis Achim.Zeileis at uibk.ac.at
Fri Jun 8 10:40:59 CEST 2012


On Fri, 8 Jun 2012, Kazu Nada wrote:

> Hi, I need help to do "mlogit" including "l( ) function.
> When I put following command,
> "Error in  parse(text = x) :  <text>:2:0:" is shown.

(1) Your example is not reproducible for us, see the footer of this mail 
and follow the posting guide.

(2) You manually set up a lot of interaction terms which actually can be 
seen as alternative-specific variables. You can simplify your formula 
considerably if you use mlogit's y ~ x | z notation. See the two package 
vignettes for guidance: vignette(package = "mlogit")

> --------
> res1<-(mlogit(choice~train+bus+plane+taxi+year+cost
> +I(gen*train)+I(gen*bus)+I(gen*plane)+I(gen*taxi)+I(gen*year)+I(gen*cost)
> +I(age*train)+I(age*bus)+I(age*plane)+I(age*taxi)+I(age*year)+I(age*cost)
> +I(prep*train)+I(prep*bus)+I(prep*plane)+I(prep*taxi)+I(prep*year)+I(prep*cost)
> +I(inc*train)+I(inc*bus)+I(inc*plane)+I(inc*taxi)+I(inc*year)+I(inc*cost)
> +I(tour*train)+I(tour*bus)+I(tour*plane)+I(tour*taxi)+I(tour*year)+I(tour*cost)
> +I(ecot*train)+I(ecot*bus)+I(ecot*plane)+I(ecot*taxi)+I(ecot*year)+I(ecot*cost)
> +I(kibo*train)+I(kibo*bus)+I(kibo*plane)+I(kibo*taxi)+I(kibo*year)+I(kibo*cost)
> ,data=dat))
> --------
>
> I appreciate if you could provide me any suggestion.
>
> Thank you.
> Kaz
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list