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
Thank you very much in advance, any help is greatly appreciated.
Kind regards,
Philipp
0 Response to mixlpred command after mixlogit
Post a Comment