Thank you so much for the suggestion.
I want to estimate interactions between "the attributes of the choice set"
and "subject-specific data (e.g., gender or income)".
However, y ~ x | z notation is to see the interaction between "the
alternatives of choice set" and "subject-specific data (e.g., gender or
income)".

Therefore, I need to put the interaction terms after terms suggesting
attributes.

Any suggestions would be grateful.

Kaz

2012/6/8 Achim Zeileis <Achim.Zeileis@uibk.ac.at>

> 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@r-project.org mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>

	[[alternative HTML version deleted]]

