Dear collegues,
I'm currently working on a consumers survey. In this survey, we asked consumers to rank their preferred labelling scheme among a pool of nine alternatives (and a no-alternative option). For each consumers, we thus have their most prefered option among 10.
After that, I wanted to analyse the answers provided to better understand how consumers' preferences are structured. To do so, i used the cmmixlogit command.
My data are organised as follow :

- ID identifies each respondent (here, i present data only for my first two respondents)
- Rang: Equal to 1 for the chosen option, otherwise equal to 0
- Alternatives = Associated alternatives
- The remaining variables are related to individual characteristics.
For exemple, my first respondent ranked the health allegation as his/her favourite scheme. The second consumer did the same.
I used the followind code line to launched my mixed logit choice model
I get consistent results. But after this step, i want to measure the marginal effect of explanatory variables on the preference expressed.
I thus tried to use first the following command
Unfortunately, I get the following error message :
alternative Com.equi is not in the fitted model; error in option outcome()
r(458);
I then tried to used the same command, but using only one explanatory variable
I also get an error message :
no cases remain after removing invalid observations
r(2000);
So I'm unable to analyse my marginal effects, and I don't see how to get around these problems. Has anyone had this problem before? Do you have any potential solutions for me?
Thank you in advance for your time
Best regards
Jean-François
I'm currently working on a consumers survey. In this survey, we asked consumers to rank their preferred labelling scheme among a pool of nine alternatives (and a no-alternative option). For each consumers, we thus have their most prefered option among 10.
After that, I wanted to analyse the answers provided to better understand how consumers' preferences are structured. To do so, i used the cmmixlogit command.
My data are organised as follow :
- ID identifies each respondent (here, i present data only for my first two respondents)
- Rang: Equal to 1 for the chosen option, otherwise equal to 0
- Alternatives = Associated alternatives
- The remaining variables are related to individual characteristics.
For exemple, my first respondent ranked the health allegation as his/her favourite scheme. The second consumer did the same.
I used the followind code line to launched my mixed logit choice model
Code:
cmset ID alternatives cmmixlogit rang, casevars(i.recode_age i.genre deplittoral prix_crit enfant univ tradi prefgeo) basealternative (10)
I thus tried to use first the following command
Code:
margins, dydx(*)
alternative Com.equi is not in the fitted model; error in option outcome()
r(458);
I then tried to used the same command, but using only one explanatory variable
Code:
margins, dydx(prix_crit)
no cases remain after removing invalid observations
r(2000);
So I'm unable to analyse my marginal effects, and I don't see how to get around these problems. Has anyone had this problem before? Do you have any potential solutions for me?
Thank you in advance for your time
Best regards
Jean-François
Comment