I wanted to ask if anyone knows how to implement the mixlogit command when you have proportions. In my example, y represents the proportion of individuals picking item 1 a time 1. 1-y is the proportion of individuals who did not pick item 1.
Next, I've followed the advice of the 2nd post here: https://www.statalist.org/forums/for...n-rating-scale
But all variants of mixlogit don't work for me such as: mixlogit dep k [pw=y], group(id) rand(x1)
In the above case, I get an error saying : weights must be the same for all observations in a group. Since all id's will have different y's, does anyone know how I can implement the command with my data?
Many thanks!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(id y k x1 t) long newid float(n dep) 1 .002072341 4.874727 4.62 1 1 1 1 1 .9979277 4.874727 4.62 1 2 2 0 2 .0037607455 5.384451 4.46 1 3 1 1 2 .9962392 5.384451 4.46 1 4 2 0 3 .006420378 3.514521 4.76 1 5 1 1 3 .9935796 3.514521 4.76 1 6 2 0 4 .0030985705 6.375185 5.06 1 7 1 1 4 .9969015 6.375185 5.06 1 8 2 0 5 .004318112 3.737104 5.2 1 9 1 1 5 .9956819 3.737104 5.2 1 10 2 0 6 .00248359 3.7184365 .2 1 11 1 1 6 .9975164 3.7184365 .2 1 12 2 0 7 .008919741 3.679313 3.99 1 13 1 1 7 .9910803 3.679313 3.99 1 14 2 0 8 .002419378 4.843454 5.06 1 15 1 1 8 .9975806 4.843454 5.06 1 16 2 0 9 .004127612 5.683865 5.22 1 17 1 1 9 .9958724 5.683865 5.22 1 18 2 0 10 .0023773876 6.376777 4.11 1 19 1 1 10 .9976226 6.376777 4.11 1 20 2 0 11 .002161125 6.53898 4.11 2 21 1 1 11 .9978389 6.53898 4.11 2 22 2 0 12 .004792569 3.383333 .2 2 23 1 1 12 .9952074 3.383333 .2 2 24 2 0 13 .0017331602 4.877793 5.06 2 25 1 1 13 .9982668 4.877793 5.06 2 26 2 0 14 .0025436045 5.78125 4.46 2 27 1 1 14 .9974564 5.78125 4.46 2 28 2 0 15 .004611214 5.543891 5.22 2 29 1 1 15 .9953888 5.543891 5.22 2 30 2 0 16 .004510679 5.595192 5.06 2 31 1 1 16 .9954893 5.595192 5.06 2 32 2 0 17 .009309353 3.679394 3.99 2 33 1 1 17 .9906906 3.679394 3.99 2 34 2 0 18 .0046460396 3.860588 5.2 2 35 1 1 18 .9953539 3.860588 5.2 2 36 2 0 19 .007048203 3.59 4.76 2 37 1 1 19 .9929518 3.59 4.76 2 38 2 0 20 .0018098027 4.966027 4.62 2 39 1 1 20 .9981902 4.966027 4.62 2 40 2 0 21 .0021115127 4.88726 4.62 3 41 1 1 21 .9978885 4.88726 4.62 3 42 2 0 22 .002664701 6.19 5.06 3 43 1 1 22 .9973353 6.19 5.06 3 44 2 0 23 .00199405 5.79 4.46 3 45 1 1 23 .9980059 5.79 4.46 3 46 2 0 24 .0029257545 5.869352 5.22 3 47 1 1 24 .9970742 5.869352 5.22 3 48 2 0 25 .0009679417 5.49 5.06 3 49 1 1 25 .9990321 5.49 5.06 3 50 2 0 end
0 Response to 'Mixlogit' with proportions - how can I implement?
Post a Comment