Hello,
This is my first post here, please pardon me for any mistake or obvious errors, but I haven't found an answer to my problem in the forum.
I am working on Stata 14 on the analysis of a discrete choice experiment. I am using a mixed logit regression (-mixlogit- package) and am trying to include interaction terms between a factor variable (a characteristic of the respondent, named -know_water-) and one of the attributes of the choice experiment -inf_100-.
My code looks like so
I systematically get the error "interactions not allowed" however I change the code. I also tried it with the gmnl package, and it did not work (code below):
However, I have performed the same interactions with a multinomial conditional logit regression without problem, like so:
My -know_water- variable was encoded from string to a factorial variable successfully, since it worked with the conditional logit regression
Is my code wrong ? Or is it the whole -mixlogit- package that does not allow for interactions ? In this case, would you have any recommendations for other packages on Stata14 ?
Thank you in advance
Georges Farina
This is my first post here, please pardon me for any mistake or obvious errors, but I haven't found an answer to my problem in the forum.
I am working on Stata 14 on the analysis of a discrete choice experiment. I am using a mixed logit regression (-mixlogit- package) and am trying to include interaction terms between a factor variable (a characteristic of the respondent, named -know_water-) and one of the attributes of the choice experiment -inf_100-.
My code looks like so
Code:
global randvars "inf_50 inf_100 heat_20 heat_40 heat_60 red_car dist_0 dist_100 dist_500 sq" mixlogit choice inf_100#i.know_water, group(chid) id(id) nrep(500) rand($randvars payment) ln(1)
Code:
gmnl choice, group(chid) id(id) nrep(500) rand($randvars mpayment )ln(1) mixl
Code:
clogit choice $randvars payment inf_100##know_water, group(chid)
Code:
encode know_origin_water, gen(know_water)
Thank you in advance
Georges Farina
Comment