Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Retrieving p-values from -cmmixlogit- and -cmxtmixlogit- commands

    Dear Statalist,

    I deal with choice data. Briefly, each respondent made 8 choices from 2 alternatives described by 7 attributes.

    I was used to perform mixed logit models with the -mixlogit- command and its extensions from Arne Risa Hole. I'm exploring now the capabilities of the -cm- package available since Stata 16 which allows to specify case-specific variables and to deal with all the margins features.

    I have two concerns. The first is that Stata doesn't provide the p-values of the SD of random coefficients, while it provides SE and confidence interval. I know it is possible to retrieve p-values but i am not comfortable with the computation. Does anyone know what it is exactly the formula to retrieve p-values?

    My second concern is about the use of the -scalemetric(unconstrained)- option. If I had well understood, it allows to deal with SD coefficients near to zero when facing convergence issues. When specifying this option, convergence is indeed easier. However, the estimation gives negative SD coefficients and reports only the standard error (and not the confidence interval). Is it correct to interpret the negative SD coefficients as being positive like when using the -mixlogit- command?


    HTML Code:
    Iteration 40: Log simulated-likelihood = -1326.5941  
    
    Mixed logit choice model                     Number of obs        =      4,800
                                                 Number of cases      =      2,400
    Panel variable: id                           Number of panels     =        300
    
    Time variable: choice_~t                     Cases per panel: min =          8
                                                                  avg =        8.0
                                                                  max =          8
    
    Alternatives variable: alt                   Alts per case:   min =          2
                                                                  avg =        2.0
                                                                  max =          2
    Integration sequence:          random
    Integration points:               500             Wald chi2(17)   =     127.71
    Log simulated-likelihood = -1326.5941             Prob > chi2     =     0.0000
    
    --------------------------------------------------------------------------------------------------------------------------------
                                                            choice | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    ---------------------------------------------------------------+----------------------------------------------------------------
    alt                                                            |
                                                                x7 |  -.0213756   .0020901   -10.23   0.000    -.0254721    -.017279
                                                                   |
                                                                x1 |
                                                         By phone  |  -1.086934   .1312381    -8.28   0.000    -1.344156   -.8297121
                                              By video conference  |  -1.152181   .1411492    -8.16   0.000    -1.428828   -.8755332
                                                                   |
                                                                x2 |
                                              Mental health issue  |  -.3057931   .1168033    -2.62   0.009    -.5347232   -.0768629
                          Sexual and/or reproductive health issue  |   -.385047      .1204    -3.20   0.001    -.6210266   -.1490675
                                                                   |
                                                                x3 |
                                             Complex health issue  |   .1011919   .1443635     0.70   0.483    -.1817554    .3841391
                                              Severe health issue  |  -.0175904   .1441243    -0.12   0.903    -.3000689     .264888
                                              Urgent health issue  |    .128744   .1486268     0.87   0.386    -.1625591     .420047
                                               Known health issue  |   .2281683   .1475545     1.55   0.122    -.0610332    .5173699
                                                                   |
                                                                x4 |
             I don't know the GP, but he/she has access to my EHR  |  -.3771844    .101947    -3.70   0.000    -.5769967    -.177372
    I don't know the GP, and he/she doesn't have access to my EHR  |  -.6299359   .1076078    -5.85   0.000    -.8408433   -.4190286
                                                                   |
                                                                x5 |
                                             In two to seven days  |  -.3809516   .1001519    -3.80   0.000    -.5772457   -.1846575
                                              In more than a week  |  -.8250788   .1235866    -6.68   0.000    -1.067304   -.5828534
                                                                   |
                                                                x6 |
                                                           1 hour  |   -.322185   .1377035    -2.34   0.019     -.592079    -.052291
                                                         1.5 hour  |  -.2368458   .1318407    -1.80   0.072    -.4952489    .0215572
                                                          2 hours  |  -.4732087   .1367653    -3.46   0.001    -.7412637   -.2051537
                                                        2.5 hours  |  -.6738228   .1373968    -4.90   0.000    -.9431157   -.4045299
    ---------------------------------------------------------------+----------------------------------------------------------------
    /Normal                                                        |
                                                           sd(1.x1)|          0  (constrained)
                                                           sd(2.x1)|   .5916916   .1857062                      .3198456    1.094587
                                                           sd(3.x1)|   .8866804   .1653294                       .615252    1.277854
                                                           sd(1.x2)|   .3151563   .2694063                      .0590052    1.683301
                                                           sd(2.x2)|          0  (constrained)
                                                           sd(3.x2)|   .7422964   .2150186                      .4207388    1.309611
                                                           sd(1.x3)|          0  (constrained)
                                                           sd(2.x3)|   .2994315   .3213727                      .0365362    2.453985
                                                           sd(3.x3)|    .010682    .304374                      5.95e-27    1.92e+22
                                                           sd(4.x3)|    .726889   .2805639                      .3411318    1.548867
                                                           sd(5.x3)|   .8936325   .2381556                      .5300432     1.50663
                                                           sd(1.x4)|          0  (constrained)
                                                           sd(2.x4)|   .3392724   .2398949                      .0848546    1.356506
                                                           sd(3.x4)|   .4499961   .2099579                      .1803257    1.122949
                                                           sd(1.x5)|          0  (constrained)
                                                           sd(2.x5)|   .5086415   .2018011                      .2337232    1.106934
                                                           sd(3.x5)|   .8542586   .1614395                       .589831    1.237232
                                                           sd(1.x6)|          0  (constrained)
                                                           sd(2.x6)|   .6745947   .2843739                       .295271    1.541221
                                                           sd(3.x6)|   .0225365   .9279188                      2.02e-37    2.51e+33
                                                           sd(4.x6)|   .5246342   .3119133                      .1636016    1.682386
                                                           sd(5.x6)|   .2619938   .4311212                      .0104137    6.591387
    ---------------------------------------------------------------+----------------------------------------------------------------
    1                                                              |  (base alternative)
    ---------------------------------------------------------------+----------------------------------------------------------------
    2                                                              |
                                                             _cons |  -.0786649   .0702224    -1.12   0.263    -.2162982    .0589684
    --------------------------------------------------------------------------------------------------------------------------------

    Thanks all for your help.

    Best regards,

    Gabin


  • #2
    this is not an area I work in so I'm not sure this will give what you want, but most Stata estimation commands, including the 2 you mention, return results in "r(table)", including p-values; so, after estimating your command, type
    Code:
    mat li r(table)
    and see if what you want is there; if so, you can extract using standard matrix commands; for example, see
    Code:
    h el()

    Comment


    • #3
      Originally posted by Rich Goldstein View Post
      this is not an area I work in so I'm not sure this will give what you want, but most Stata estimation commands, including the 2 you mention, return results in "r(table)", including p-values; so, after estimating your command, type
      Code:
      mat li r(table)
      and see if what you want is there; if so, you can extract using standard matrix commands; for example, see
      Code:
      h el()
      Dear Rich,

      Thanks for the tip, I didn't know it! But z-values and p-values are not stored in the matrix...

      Comment


      • #4
        The z-values are in the third row, and the p-values in the fourth row:

        Code:
        . webuse inschoice, clear
        (Fictional health insurance data)
        
        . cmset id insurance
        
             Case ID variable: id
        Alternatives variable: insurance
        
        . qui cmmixlogit choice premium, random(deductible) or
        
        . matlist r(table)
        
                     | insurance            | /Normal   | Health    | SickInc   | MGroup    | MoonHea~h 
                     |   premium  deducti~e | sd(dedu~e) |     _cons |     _cons |     _cons |     _cons 
        -------------+----------------------+-----------+-----------+-----------+-----------+----------
                   b |  .0691011   .3295673 |  .8886822 |  1.683536 |  .4305793 |  .1215871 |  .0346932 
                  se |  .0186256    .111198 |  .3641774 |    .50165 |  .1252628 |  .0539479 |  .0235775 
                   z | -9.913801  -3.289729 |        .b |  1.748126 | -2.896441 | -4.749013 | -4.945871 
              pvalue |  3.63e-23   .0010028 |        .b |  .0804422 |  .0037742 |  2.04e-06 |  7.58e-07 
                  ll |  .0407427   .1701154 |  .3980416 |  .9388287 |  .2434581 |  .0509579 |  .0091573 
                  ul |  .1171977   .6384762 |  1.984104 |  3.018967 |  .7615213 |  .2901104 |   .131438 
                  df |         .          . |         . |         . |         . |         . |         . 
                crit |  1.959964   1.959964 |  1.959964 |  1.959964 |  1.959964 |  1.959964 |  1.959964 
               eform |         1          1 |         0 |         1 |         1 |         1 |         1
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment

        Working...
        X