I am currently trying to simulate multinomial logit in stata (obs 1000). I have five explanatory variables and pre-determined slope coefficients. I generate the depended variable using the following:
gen p0 = 1 / ( 1 + exp(xb1) + exp(xb2) ) gen p1 = exp(xb1) / ( 1 + exp(xb1) + exp(xb2) ) gen p2 = exp(xb2) / ( 1 + exp(xb1) + exp(xb2) ) gen u = runiform() gen y = 0 replace y=1 if u>p0 % u<p1+p2 replace y=2 if u>p1+p2 After running mlogit command with base(0), slope coefficient do not converge to the true values. Also all predicted probabilities are between 0 and 0.5.
Can someone help me figure out what can be the problem?
gen p0 = 1 / ( 1 + exp(xb1) + exp(xb2) ) gen p1 = exp(xb1) / ( 1 + exp(xb1) + exp(xb2) ) gen p2 = exp(xb2) / ( 1 + exp(xb1) + exp(xb2) ) gen u = runiform() gen y = 0 replace y=1 if u>p0 % u<p1+p2 replace y=2 if u>p1+p2 After running mlogit command with base(0), slope coefficient do not converge to the true values. Also all predicted probabilities are between 0 and 0.5.
Can someone help me figure out what can be the problem?
Comment