I have this example data that I have reshaped from wide to long. I want to use it to compare different choice models, specifically, the multinomial probit, mixed logit model, and random parameter model. The problem is that I keep getting the error "depvar choice must be a 0/1 variable indicating which alternatives are chosen." I would appreciate some assistance.[
]
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double(cost indemnity diseaseuncertainty) str17 responseid long choice str7 alternative2 1.5 .75 0 "R_12c0WhpSacmBfND" 3 "choiceA" 1.5 .75 0 "R_12c0WhpSacmBfND" 2 "choiceB" 1.5 .75 0 "R_12c0WhpSacmBfND" 3 "choiceC" 0 .75 1 "R_130tjeDa0SB0a7n" 2 "choiceA" 0 .75 1 "R_130tjeDa0SB0a7n" 2 "choiceB" 0 .75 1 "R_130tjeDa0SB0a7n" 4 "choiceC" 3 .8999999761581421 0 "R_17ro9DXzTCsyb4d" 3 "choiceA" 3 .8999999761581421 0 "R_17ro9DXzTCsyb4d" 4 "choiceB" 3 .8999999761581421 0 "R_17ro9DXzTCsyb4d" 4 "choiceC" 3 .8999999761581421 0 "R_1B19p1QowTgqSm5" 3 "choiceA" 3 .8999999761581421 0 "R_1B19p1QowTgqSm5" 4 "choiceB" 3 .8999999761581421 0 "R_1B19p1QowTgqSm5" 4 "choiceC" 1.5 .75 0 "R_1H7wPWuH1CbkDmD" 3 "choiceA" 1.5 .75 0 "R_1H7wPWuH1CbkDmD" 4 "choiceB" 1.5 .75 0 "R_1H7wPWuH1CbkDmD" 3 "choiceC" . . . "R_1Ino1LWi1nJIdUn" 3 "choiceA" . . . "R_1Ino1LWi1nJIdUn" 2 "choiceB" . . . "R_1Ino1LWi1nJIdUn" 4 "choiceC" 3 .8999999761581421 0 "R_1JFmXqFfifSI8p2" 3 "choiceA" 3 .8999999761581421 0 "R_1JFmXqFfifSI8p2" 4 "choiceB" end label values diseaseuncertainty diseaseuncertainty label def diseaseuncertainty 0 "low", modify label def diseaseuncertainty 1 "high", modify label values choice choice label def choice 2 "1", modify label def choice 3 "2", modify label def choice 4 "3", modify
Comment