Dear all,

I am using data from a choice experiment with an unbalanced panel of 2-3 alternatives per choice set, and either 6 or 9 choice sets per respondent. I am using Stata 16 and primarily the commands - cmclogit - and - margins -. This relates to transport mode choices.

I am trying to obtain the marginal effect on the probability of a given alternative being chosen. My primary approach has been to use - cmclogit -, not using the - casevars() - option but instead directly interacting the case vars with an alternative dummy to avoid overloading the model - for a number of variables I only want to estimate the effect on one alternative, eg. impact of car type on car use (relative to the base alternative), not also on the other alternative.

After running the model, using margins produces output that I cannot understand and I have been unable to find explanation for or clarification of in the manuals or on statalist. Specifically, instead of producing the marginal effect on the probability of each mode/alternative, it produces interactions of the alternatives _outcome#alt. What is this? Why am I unable to get just _outcome? The interactions make no sense - eg. what does the estimate mean for PT#CR. And then perhaps another issue is that it only gives margins estimations for some of these, not all (see below). Adding the - at() - option doesn't help in this case.

Can anyone help me understand what is going on here? Or what I can do to obtain margins estimates for the alternatives?


A brief data extract is shown here for one respondent:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int id byte alt float(rep chosen) byte type float(totcost tottime) byte region float(hh_size romand commute ln_comm_dist biosph_import car_inhh)
7 1 1 0 1   23  46 3 1 0 1 3.3322046 1 1
7 2 1 1 1  2.6  18 3 1 0 1 3.3322046 1 1
7 1 2 0 1   23  23 3 1 0 1 3.3322046 1 1
7 2 2 1 1  2.6  53 3 1 0 1 3.3322046 1 1
7 1 3 0 1   23  69 3 1 0 1 3.3322046 1 1
7 2 3 1 1  2.6  18 3 1 0 1 3.3322046 1 1
7 1 1 0 2  6.8  10 3 1 0 0 3.3322046 1 1
7 2 1 1 2 .312  21 3 1 0 0 3.3322046 1 1
7 3 1 0 2    0  60 3 1 0 0 3.3322046 1 1
7 1 2 0 2  6.8  30 3 1 0 0 3.3322046 1 1
7 2 2 1 2 .312  21 3 1 0 0 3.3322046 1 1
7 3 2 0 2    0  20 3 1 0 0 3.3322046 1 1
7 1 3 0 2  6.8  20 3 1 0 0 3.3322046 1 1
7 2 3 1 2 .312  21 3 1 0 0 3.3322046 1 1
7 3 3 0 2    0  60 3 1 0 0 3.3322046 1 1
7 1 1 0 3   31  81 3 1 0 0 3.3322046 1 1
7 2 1 1 3 6.24  35 3 1 0 0 3.3322046 1 1
7 1 2 0 3   31  41 3 1 0 0 3.3322046 1 1
7 2 2 1 3 6.24 105 3 1 0 0 3.3322046 1 1
7 1 3 0 3   31 122 3 1 0 0 3.3322046 1 1
7 2 3 1 3 6.24  35 3 1 0 0 3.3322046 1 1
end
label values alt choice_lab
label def choice_lab 1 "PT", modify
label def choice_lab 2 "CR", modify
label def choice_lab 3 "BF", modify
label values type type_lab
label def type_lab 1 "Commute", modify
label def type_lab 2 "Leisure", modify
label def type_lab 3 "Weekend", modify
label values region region_lab
label def region_lab 3 "Countryside", modify
A modified (shortened) example of my code is below, where CR and BF are dummies for those two alternatives (the base alternative being PT):
Code:
cmclogit chosen totcost tottime CR BF c.CR#i.type c.BF#i.type c.CR#ib1.region c.BF#ib1.region ///
         c.CR#ib2.hh_size c.BF#ib2.hh_size c.CR#i.romand c.BF#i.romand c.CR#c.commute#c.ln_comm_dist  ///
         c.BF#c.commute#c.ln_comm_dist c.CR#c.biosph_import c.BF#c.biosph_import c.CR#car_inhh c.BF#car_inhh ///
         , vce(cl id2) nocons allbaselevels
Using the simplest version of margins I can as an example, I write:
Code:
margins , dydx( region) vce(unconditional) outcome(, altsubpop) 

Average marginal effects                        Number of obs     =     19,275

Expression   : Pr(alt|1 selected), predict()
dy/dx w.r.t. : 2.region 3.region

                                      (Std. Err. adjusted for 2,604 clusters in id2)
------------------------------------------------------------------------------------
                   |            Unconditional
                   |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
1.region  |  (base outcome)
-------------------+----------------------------------------------------------------
2.region  |
      _outcome#alt |
            PT#PT  |          0  (empty)
            PT#CR  |   -.068618   .0130747    -5.25   0.000     -.094244    -.042992
            PT#BF  |  -.0123124   .0077902    -1.58   0.114    -.0275809     .002956
            CR#PT  |          0  (empty)
            CR#CR  |          0   .0006932     0.00   1.000    -.0013586    .0013586
            CR#BF  |          0   .0002497     0.00   1.000    -.0004893    .0004893
            BF#PT  |          0  (empty)
            BF#CR  |          0     .00075     0.00   1.000    -.0014699    .0014699
            BF#BF  |          0   .0002425     0.00   1.000    -.0004752    .0004752
-------------------+----------------------------------------------------------------
3.region  |
      _outcome#alt |
            PT#PT  |          0  (empty)
            PT#CR  |  -.0611379   .0145159    -4.21   0.000    -.0895886   -.0326872
            PT#BF  |  -.0249792   .0092992    -2.69   0.007    -.0432053   -.0067531
            CR#PT  |          0  (empty)
            CR#CR  |          0   .0006148     0.00   1.000     -.001205     .001205
            CR#BF  |          0   .0005097     0.00   1.000     -.000999     .000999
            BF#PT  |          0  (empty)
            BF#CR  |          0   .0006668     0.00   1.000    -.0013069    .0013069
            BF#BF  |          0   .0004572     0.00   1.000     -.000896     .000896
------------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.