Dear Stata Users,

I run a mixed logit model (-mixlogit-) to identify preferences in a choice experiment with Stata 15.1. After running the model I want to investigate how the probability of choosing an alternative changes if one attribute changes, i.e. I want to predict probabilities and marginal effects.

I followed the steps suggested by A. Hole on slide 16 here: https://www.stata.com/meeting/uk13/a.../uk13_hole.pdf. In his example on conumer's choices of electricity suppliers, where also data is provided, as in my case -mixlogit- is followed by the -mixlpred- command in the following way:

Code:
preserve
set seed 12345
gen rnd = runiform()
bysort pid gid (rnd): gen alt = _n
replace wknown = 0 if alt==1
mixlpred p0, nrep(500)
replace wknown = 1 if alt==1
mixlpred p1, nrep(500)
gen p_diff = p1-p0
where 'wknown' is the attribute whether an electricity supplier is well-known and p_diff gives the marginal effect. I understand that probabilities are estimated before and after a change in the variable. However, I do not understand why this change is done for each individual only for one alternative (alt==1, not necessarily the alternative that was chosen by the consumer) and not for all alternatives. Does anyone have an idea why the change is made in one alternative only?

Thank you very much in advance, any help is greatly appreciated.

Kind regards,
Philipp