Hi,
I am trying to start using cm commands using Stata/MP 17.0 instead of clogit or mixlogit.
I have a data set that is obtained from a fully randomized case I (object case) best-worst-scalling method. The experiment in total contains 18 objects and each individual were faced with 6 different choice sets and each choice set contained 3 objects from which the respondents was asked to choose the best and worst objects. The models I am trying to estimat are similar to models estimated by Lusk and Briggeman (2009) or Bazzani et al. (2018), only with different numbers of items, set size, and experimental design. This is how the data looks like:
Where the group id is obtained as egen gid = group(id set) and objects; att1-att18 are effect coded such that the object takes value 1 if it is chosen as best, -1 if chosen as worst, and 0 if not chosen.
I have no trouble replicating the results from clogit using cmlogit:
Although I get the note that
for all $var but I assume that is due to these objects being effect-coded and are zero for many alternatives. I do not get such note when using clogit.
The problem starts with estimating a random parameter logit (RPL) model. I can easily estimate an RPL model with the following code:
or any other number of halton draw (nrep), it just takes longer as the number of halton draws increase. However, I cannot get the same model to converge using cmxtmixlogit. Following are a set of failed attempts in which I tried to incorporate some advices from @Hong Il Yoo or others. These models all get stuck in numerous iterations that either (backed up) or (not concave):
I tried to the feed the model with estimates from mixlogit:
and I get the following error for all of them:
So, I wonder:
Thanks in advance for your help.
I am trying to start using cm commands using Stata/MP 17.0 instead of clogit or mixlogit.
I have a data set that is obtained from a fully randomized case I (object case) best-worst-scalling method. The experiment in total contains 18 objects and each individual were faced with 6 different choice sets and each choice set contained 3 objects from which the respondents was asked to choose the best and worst objects. The models I am trying to estimat are similar to models estimated by Lusk and Briggeman (2009) or Bazzani et al. (2018), only with different numbers of items, set size, and experimental design. This is how the data looks like:
HTML Code:
list id set alt gid B W choice $items in 1/12, table ab(6) sep(6) noobs nol +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | id set alt gid B W choice att1 att2 att3 att4 att5 att6 att7 att8 att9 att10 att11 att12 att13 att14 att15 att16 att17 att18 | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 1 1 1 2 13 1 0 1 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 | | 1 1 2 1 2 13 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 | | 1 1 3 1 2 13 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 -1 0 0 | | 1 1 4 1 2 13 0 0 -1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 | | 1 1 5 1 2 13 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 | | 1 1 6 1 2 13 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 1 0 0 | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 1 2 3 17 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 | | 1 2 2 2 3 17 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 | | 1 2 3 2 3 17 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 -1 0 | | 1 2 4 2 3 17 0 0 0 -1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 | | 1 2 5 2 3 17 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 | | 1 2 6 2 3 17 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 1 0 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
I have no trouble replicating the results from clogit using cmlogit:
Code:
global var "att1 att2 att3 att4 att5 att6 att7 att8 att9 att10 att11 att12 att14 att15 att16 att17 att18" cmset id set alt clogit choice $var, group(gid) cmclogit choice $var, noconstant // same results as clogit but clustor robust s.e.
HTML Code:
variable att1 has # cases that are not alternative-specific; there is no within-case variability.
The problem starts with estimating a random parameter logit (RPL) model. I can easily estimate an RPL model with the following code:
Code:
mixlogit choice, rand($var) id(id) group(gid) nrep(500) burn(50)
Code:
cmset id set alt cmxtmixlogit choice, random($var) intpoints(50) intmethod(halton) intburn(15) noconstant cmxtmixlogit choice, random($var) intpoints(50) intmethod(halton) intburn(15) technique(bfgs) noconstant cmxtmixlogit choice, random($var) intpoints(50) intmethod(halton, antithetics) intburn(15) technique(bfgs) noconstant cmxtmixlogit choice, random($var) intpoints(10) noconstant cmxtmixlogit choice, random($var) intpoints(10) intmethod(halton) technique(bhhh) noconstant collinear cmxtmixlogit choice, random($var) intpoints(10) intmethod(halton) technique(bfgs) noconstant cmxtmixlogit choice, random($var) intpoints(10) technique(bhhh) noconstant cmxtmixlogit choice, random($var) intpoints(10) technique(bfgs) noconstant cmxtmixlogit choice, random($var) intpoints(10) intmethod(halton, antithetics) technique(bfgs) noconstant cmxtmixlogit choice, random($var) intpoints(10) intmethod(halton, antithetics) technique(bhhh) noconstant
Code:
cmset id set alt egen gid = group(id set) mixlogit choice, rand($var) id(id) group(gid) mat b = e(b) cmxtmixlogit choice, random($var) from(b, skip) noconstant cmxtmixlogit choice, random($var) from(b, skip) intmethod(halton) intpoints(50) intburn(15) noconstant cmxtmixlogit choice, random($var) from(b, skip) intmethod(halton, antithetics) intpoints(50) intburn(15) noconstant cmxtmixlogit choice, random($var) from(b, skip) intmethod(halton, antithetics) noconstant * Tried with from(b, copy) as well
HTML Code:
Fitting fixed parameter model: Fitting full model: initial values not feasible r(1400);
- Is there anything wrong with the data set up or the codes that I am using or mixlogit is better at estimating such a model?
- If there is nothing wrong with my set up/codes, is there any benefit in trying to fit model with cmxtmixlogit, given that in this particular case, the main postestimation command I am interested in is to predict the individual-specific parameters which can be abtained by mixlbeta after mixlogit - which I assume is the equivalent to predict scores stub* after cmxtmixlogit.
Thanks in advance for your help.
Comment