Announcement

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

  • Determining Relative Importance of Predictors using Domme

    Hello Everyone,

    I am rather new to Stata, and this is my first post.

    I have panel data with 156,790 obs. I have run four regression models using xtlogit, xtologit, and xtstreg. The results show that all my predictor variables are very significant. I have checked for multicollinearity, and that is not an issue with my dataset. Now, I would like to determine the relative importance of each predictor within the model. According to what I could find, the domme command written by Joseph Luchman seems to be what I am look for. However, I am not sure if I am typing the commands correctly (I assume not). Below is the command, but I receive the error message "option ( not allowed".

    Code:
    domme, (use_of_force = total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted = use_of_force)) reg(xtlogit use_of_force total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted) fitstat(e(rank), mcf)
    I have include some example data for reference. See below.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float use_of_force double total_legitimacy_final byte leadership_power float capability_preponderance byte system_effects_isolation double core_interests_weighted
    1               .095 1 0 0 1.9
    1               .095 1 0 0 1.9
    1               .095 1 0 0   .
    1               .095 1 0 0   .
    1               .095 1 0 0 1.3
    1               .095 1 0 0 1.3
    1               .095 1 0 0 1.3
    1               .095 1 0 0 1.3
    1               .095 1 0 0   .
    1               .095 1 0 0   .
    1               .095 1 0 0 1.9
    1               .095 1 0 0 1.9
    0               .155 2 0 0   1
    1               .155 2 0 0   1
    0               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    0               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    0               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0  .8
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    0               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    0               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    1               .155 2 0 0   1
    0               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    0               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1               .155 2 0 0 1.5
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0 1.2
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .17 3 0 0  .8
    1                .24 4 0 0   1
    1 3.1641596638655467 5 0 0 1.7
    1 3.1641596638655467 5 0 0 1.7
    0 3.1641596638655467 5 0 0 1.7
    end
    Any suggestions would be greatly appreciated.

  • #2
    Hi Ray,

    The specific issue here is because the

    Code:
     
     (use_of_force = total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted = use_of_force))
    Statement is submitted as an option (after the comma) instead of as an argument to -domme-.

    There are a couple of other issues in the code as well that will prevent the command from running as well.

    I've included a variant of the first example from -xtlogit- below that runs in -domme-; whether it is a good idea to use the McFadden pseudo-R2 for that model is another question. To be clear, it could be. Have yet to see any work on relative importance with random effect logit models. Though I do believe there are R2s available for such models (e.g., Nakagawa, Johnson, & Schielzeth, 2017) that would likely be a better choice.

    Code:
    . webuse union, clear
    (NLS Women 14-24 in 1968)
    
    . xtlogit union age grade i.not_smsa south year
    
    Fitting comparison model:
    
    Iteration 0:   log likelihood =  -13864.23  
    Iteration 1:   log likelihood = -13548.769  
    Iteration 2:   log likelihood = -13544.533  
    Iteration 3:   log likelihood = -13544.531  
    Iteration 4:   log likelihood = -13544.531  
    
    Fitting full model:
    
    tau =  0.0     log likelihood = -13544.531
    tau =  0.1     log likelihood = -12925.812
    tau =  0.2     log likelihood = -12419.818
    tau =  0.3     log likelihood = -12004.006
    tau =  0.4     log likelihood =  -11658.14
    tau =  0.5     log likelihood = -11369.232
    tau =  0.6     log likelihood = -11131.793
    tau =  0.7     log likelihood =  -10949.71
    tau =  0.8     log likelihood = -10848.357
    
    Iteration 0:   log likelihood = -10949.801  
    Iteration 1:   log likelihood = -10561.473  
    Iteration 2:   log likelihood =  -10544.97  
    Iteration 3:   log likelihood = -10544.764  
    Iteration 4:   log likelihood = -10544.764  (backed up)
    Iteration 5:   log likelihood = -10544.764  
    
    Random-effects logistic regression                   Number of obs    = 26,200
    Group variable: idcode                               Number of groups =  4,434
    
    Random effects u_i ~ Gaussian                        Obs per group:
                                                                      min =      1
                                                                      avg =    5.9
                                                                      max =     12
    
    Integration method: mvaghermite                      Integration pts. =     12
    
                                                         Wald chi2(5)     = 221.30
    Log likelihood = -10544.764                          Prob > chi2      = 0.0000
    
    ------------------------------------------------------------------------------
           union | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             age |   .0155224   .0149781     1.04   0.300     -.013834    .0448789
           grade |   .0879511   .0176376     4.99   0.000     .0533821    .1225202
      1.not_smsa |  -.2555034   .0822409    -3.11   0.002    -.4166927   -.0943141
           south |  -.9376577   .0804334   -11.66   0.000    -1.095304   -.7800111
            year |   .0014745    .015396     0.10   0.924    -.0287011    .0316502
           _cons |  -3.674601   .8115014    -4.53   0.000    -5.265115   -2.084088
    -------------+----------------------------------------------------------------
        /lnsig2u |   1.747237   .0469988                      1.655122    1.839353
    -------------+----------------------------------------------------------------
         sigma_u |   2.395564   .0562943                      2.287732    2.508479
             rho |   .6356168   .0108853                      .6140276    .6566737
    ------------------------------------------------------------------------------
    LR test of rho=0: chibar2(01) = 5999.53                Prob >= chibar2 = 0.000
    
    . domme (union = age grade 1.not_smsa south year), reg(xtlogit union age grade i.not_smsa south year) fitstat(e(), mcf)
    
    Total of 31 models/regressions
    
    Progress in running all regression subsets
    0%------50%------100%
    ....................
    General dominance statistics: Random-effects logistic regression
    Number of obs             =                   26200
    Overall Fit Statistic     =                  0.0106
    
                |      Dominance      Standardized      Ranking
                |      Stat.          Domin. Stat.
    ------------+------------------------------------------------------------------------
    union       |
     age        |         0.0006      0.0600            4 
     grade      |         0.0017      0.1599            2 
     1.not_smsa |         0.0008      0.0712            3 
     south      |         0.0069      0.6529            1 
     year       |         0.0006      0.0559            5 
    -------------------------------------------------------------------------------------
    Conditional dominance statistics
    -------------------------------------------------------------------------------------
    
                       #param_ests:  #param_ests:  #param_ests:  #param_ests:  #param_ests:
                                 1             2             3             4             5
           union:age        0.0014        0.0009        0.0006        0.0003        0.0000
         union:grade        0.0025        0.0019        0.0016        0.0013        0.0012
    union:1.not_smsa        0.0011        0.0009        0.0007        0.0006        0.0005
         union:south        0.0074        0.0071        0.0069        0.0067        0.0065
          union:year        0.0013        0.0009        0.0005        0.0002        0.0000
    -------------------------------------------------------------------------------------
    Complete dominance designation
    -------------------------------------------------------------------------------------
    
                            dominated?:  dominated?:  dominated?:  dominated?:  dominated?:
                                   age        grade   1_not_smsa        south         year
           dominates?:age            0           -1            0           -1            1
         dominates?:grade            1            0            1           -1            1
    dominates?:1_not_smsa            0           -1            0           -1            0
         dominates?:south            1            1            1            0            1
          dominates?:year           -1           -1            0           -1            0
    -------------------------------------------------------------------------------------
    
    Strongest dominance designations
    
    union:grade completely dominates union:age
    union:south completely dominates union:age
    union:south completely dominates union:grade
    union:grade completely dominates union:1.not_smsa
    union:south completely dominates union:1.not_smsa
    union:age completely dominates union:year
    union:grade completely dominates union:year
    union:south completely dominates union:year
    union:1.not_smsa generally dominates union:age
    union:1.not_smsa generally dominates union:year
    Nakagawa, S., Johnson, P. C., & Schielzeth, H. (2017). The coefficient of determination R 2 and intra-class correlation coefficient from generalized linear mixed-effects models revisited and expanded. Journal of the Royal Society Interface, 14(134), 20170213.
    Joseph Nicholas Luchman, Ph.D., PStat® (American Statistical Association)
    ----
    Research Fellow
    Fors Marsh

    ----
    Version 18.0 MP

    Comment


    • #3
      Hello and thank you so much, Joseph!

      I corrected the issue with the code and ran my five models. Two of the models using xtlogit produced what appear to be accurate results. However, one model using xtlogit and another using xtologit produced very confusing results, which I think is indicative of a problem -- I assume it is not normal for results to show that all predictor variables have the same dominance statistic. I have included the code and results below and was wondering if you might know what the issue could be.

      Also, I tried to use domme to test for dominance among predictors using xtstreg, but no matter what syntax I try, I always end up with an error. I have included the code and results below as well.

      I know I am asking a lot, but any advice or insight you might have so that I can understand my mistakes would be of tremendous help.

      Best,

      Ray



      The issue with my model using xtlogit

      Code:
       
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp" 
      
       
      
      . global ylist china_orig 
      
       
      
      . global xlist total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighte 
      
      > d 
      
       
      
      .  
      
      . xtlogit $ylist $xlist 
      
       
      
      Fitting comparison model: 
      
       
      
      Iteration 0:   log likelihood = -49783.137   
      
      Iteration 1:   log likelihood = -39513.381   
      
      Iteration 2:   log likelihood = -35679.565   
      
      Iteration 3:   log likelihood = -35533.894   
      
      Iteration 4:   log likelihood = -35533.678   
      
      Iteration 5:   log likelihood = -35533.678   
      
       
      
      Fitting full model: 
      
       
      
      tau =  0.0     log likelihood = -35533.678 
      
      tau =  0.1     log likelihood = -34619.999 
      
      tau =  0.2     log likelihood = -34553.689 
      
      tau =  0.3     log likelihood = -34564.177 
      
       
      
      Iteration 0:   log likelihood = -34525.758  (not concave) 
      
      Iteration 1:   log likelihood = -34330.267   
      
      Iteration 2:   log likelihood = -34291.934   
      
      Iteration 3:   log likelihood = -34275.942   
      
      Iteration 4:   log likelihood = -34273.897   
      
      Iteration 5:   log likelihood = -34273.845   
      
      Iteration 6:   log likelihood = -34273.845   
      
      Iteration 7:   log likelihood = -34273.844   
      
       
      
      Random-effects logistic regression              Number of obs     =    152,496 
      
      Group variable: group_id                        Number of groups  =        163 
      
       
      
      Random effects u_i ~ Gaussian                   Obs per group: 
      
                                                                    min =         37 
      
                                                                    avg =      935.6 
      
                                                                    max =     28,525 
      
       
      
      Integration method: mvaghermite                 Integration pts.  =         12 
      
       
      
                                                      Wald chi2(5)      =   16436.43 
      
      Log likelihood  = -34273.844                    Prob > chi2       =     0.0000 
      
       
      
      -------------------------------------------------------------------------------------------- 
      
                      china_orig |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval] 
      
      ---------------------------+---------------------------------------------------------------- 
      
                total_legitimacy |   .3141785   .0051062    61.53   0.000     .3041705    .3241865 
      
                leadership_power |   .2750909   .0034295    80.21   0.000     .2683693    .2818125 
      
      1.capability_preponderance |   3.186951   .8524547     3.74   0.000     1.516171    4.857732 
      
      1.system_effects_isolation |  -3.581297   .0455064   -78.70   0.000    -3.670488   -3.492106 
      
         core_interests_weighted |  -.8233637   .0244947   -33.61   0.000    -.8713723   -.7753551 
      
                           _cons |  -.9407547   .8463949    -1.11   0.266    -2.599658    .7181488 
      
      ---------------------------+---------------------------------------------------------------- 
      
                        /lnsig2u |   1.298067   .1892483                      .9271476    1.668987 
      
      ---------------------------+---------------------------------------------------------------- 
      
                         sigma_u |   1.913691   .1810814                      1.589745    2.303647 
      
                             rho |   .5267793   .0471764                      .4344544    .6173085 
      
      -------------------------------------------------------------------------------------------- 
      
      LR test of rho=0: chibar2(01) = 2519.67                Prob >= chibar2 = 0.000 
      
       
      
      .  
      
      end of do-file 
      
       
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp" 
      
       
      
      . domme (china_orig = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interests_ 
      
      > weighted), reg(xtlogit recip total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_i 
      
      > nterests_weighted) fitstat(e(), est) 
      
       
      
      Total of 31 models/regressions 
      
       
      
      Progress in running all regression subsets 
      
      0%------50%------100% 
      
      .................... 
      
      General dominance statistics: Random-effects logistic regression 
      
      Number of obs             =                  153850 
      
      Overall Fit Statistic     =                 -0.0000 
      
       
      
                  |      Dominance      Standardized      Ranking 
      
                  |      Stat.          Domin. Stat. 
      
      ------------+------------------------------------------------------------------------ 
      
      china_orig  | 
      
       total_le~y |        -0.0000      0.2000            1  
      
       leadersh~r |        -0.0000      0.2000            5  
      
       1.capabi~e |        -0.0000      0.2000            1  
      
       1.system~n |        -0.0000      0.2000            1  
      
       core_int~d |        -0.0000      0.2000            1  
      
      ------------------------------------------------------------------------------------- 
      
      Conditional dominance statistics 
      
      ------------------------------------------------------------------------------------- 
      
       
      
                                #param_ests:  #param_ests:  #param_ests:  #param_ests:  #param_ests: 
      
                                          1             2             3             4             5 
      
      china_orig:total_legi~y       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      china_orig:leadership~r       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      china_orig:1.capabili~e       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      china_orig:1.system_e~n       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      china_orig:core_inter~d       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      ------------------------------------------------------------------------------------- 
      
      Complete dominance designation 
      
      ------------------------------------------------------------------------------------- 
      
       
      
                                 dominated?:   dominated?:   dominated?:   dominated?:   dominated?: 
      
                               total_legi~y  leadership~r  1_capabili~e  1_system_e~n  core_inter~d 
      
      dominates?:total_legi~y             0 
      
      dominates?:leadership~r             0             0 
      
      dominates?:1_capabili~e             0             0             0 
      
      dominates?:1_system_e~n             0             0             0             0 
      
      dominates?:core_inter~d             0             0             0             0             0 
      
      ------------------------------------------------------------------------------------- 
      
       
      
      Strongest dominance designations 
      
       
      
      china_orig:total_legitimacy generally dominates china_orig:leadership_power 
      
      china_orig:1.capability_preponderance generally dominates china_orig:leadership_power 
      
      china_orig:1.system_effects_isolation generally dominates china_orig:leadership_power 
      
      china_orig:core_interests_weighted generally dominates china_orig:leadership_power 
      
       
      
       
      
      .  
      
      end of do-file

      Here is the problem regarding the xtologit model.

      Code:
       
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp" 
      
       
      
      . global ylist hostlev_china 
      
       
      
      . global xlist total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighte 
      
      > d 
      
       
      
      .  
      
      . xtologit $ylist $xlist 
      
       
      
      Fitting comparison model: 
      
       
      
      Iteration 0:   log likelihood = -203850.52   
      
      Iteration 1:   log likelihood = -196614.62   
      
      Iteration 2:   log likelihood = -196569.64   
      
      Iteration 3:   log likelihood =  -196569.6   
      
      Iteration 4:   log likelihood =  -196569.6   
      
       
      
      Refining starting values: 
      
       
      
      Grid node 0:   log likelihood =  -196380.5 
      
       
      
      Fitting full model: 
      
       
      
      Iteration 0:   log likelihood =  -196380.5  (not concave) 
      
      Iteration 1:   log likelihood = -196267.95  (not concave) 
      
      Iteration 2:   log likelihood = -196228.98  (not concave) 
      
      Iteration 3:   log likelihood = -196189.02  (not concave) 
      
      Iteration 4:   log likelihood = -196171.21  (not concave) 
      
      Iteration 5:   log likelihood = -196155.85  (not concave) 
      
      Iteration 6:   log likelihood = -196143.72   
      
      Iteration 7:   log likelihood = -196134.62   
      
      Iteration 8:   log likelihood = -196128.53   
      
      Iteration 9:   log likelihood = -196128.51   
      
      Iteration 10:  log likelihood = -196128.51   
      
       
      
      Random-effects ordered logistic regression      Number of obs     =    152,496 
      
      Group variable: group_id                        Number of groups  =        163 
      
       
      
      Random effects u_i ~ Gaussian                   Obs per group: 
      
                                                                    min =         37 
      
                                                                    avg =      935.6 
      
                                                                    max =     28,525 
      
       
      
      Integration method: mvaghermite                 Integration pts.  =         12 
      
       
      
                                                      Wald chi2(5)      =   12121.58 
      
      Log likelihood  = -196128.51                    Prob > chi2       =     0.0000 
      
       
      
      -------------------------------------------------------------------------------------------- 
      
                   hostlev_china |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval] 
      
      ---------------------------+---------------------------------------------------------------- 
      
                total_legitimacy |  -.2433826   .0023828  -102.14   0.000    -.2480527   -.2387125 
      
                leadership_power |  -.0524987   .0010566   -49.69   0.000    -.0545695   -.0504278 
      
      1.capability_preponderance |  -.3466504   .0720078    -4.81   0.000    -.4877831   -.2055176 
      
      1.system_effects_isolation |  -.0813809   .0155824    -5.22   0.000    -.1119218     -.05084 
      
         core_interests_weighted |   .0589856   .0110868     5.32   0.000     .0372559    .0807153 
      
      ---------------------------+---------------------------------------------------------------- 
      
                           /cut1 |  -2.918554   .0739506                     -3.063495   -2.773614 
      
                           /cut2 |  -2.746528   .0739195                     -2.891408   -2.601649 
      
                           /cut3 |  -1.584418    .073715                     -1.728897    -1.43994 
      
                           /cut4 |   1.212025   .0738174                      1.067345    1.356704 
      
      ---------------------------+---------------------------------------------------------------- 
      
                       /sigma2_u |   .0104084    .001931                      .0072355    .0149727 
      
      -------------------------------------------------------------------------------------------- 
      
      LR test vs. ologit model: chibar2(01) = 882.17        Prob >= chibar2 = 0.0000 
      
       
      
      .  
      
      end of do-file 
      
       
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp" 
      
       
      
      . domme (hostlev_china = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interes 
      
      > ts_weighted), reg(xtologit recip total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation co 
      
      > re_interests_weighted) fitstat(e(), est) 
      
       
      
      Total of 31 models/regressions 
      
       
      
      Progress in running all regression subsets 
      
      0%------50%------100% 
      
      .................... 
      
      General dominance statistics: Random-effects ordered logistic regression 
      
      Number of obs             =                  153850 
      
      Overall Fit Statistic     =                 -0.0000 
      
       
      
                  |      Dominance      Standardized      Ranking 
      
                  |      Stat.          Domin. Stat. 
      
      ------------+------------------------------------------------------------------------ 
      
      hostlev_c~a | 
      
       total_le~y |        -0.0000      0.2000            1  
      
       leadersh~r |        -0.0000      0.2000            1  
      
       1.capabi~e |        -0.0000      0.2000            1  
      
       1.system~n |        -0.0000      0.2000            1  
      
       core_int~d |        -0.0000      0.2000            1  
      
      ------------------------------------------------------------------------------------- 
      
      Conditional dominance statistics 
      
      ------------------------------------------------------------------------------------- 
      
       
      
                                   #param_ests:  #param_ests:  #param_ests:  #param_ests:  #param_ests: 
      
                                             1             2             3             4             5 
      
      hostlev_china:total_legi~y       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      hostlev_china:leadership~r       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      hostlev_china:1.capabili~e       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      hostlev_china:1.system_e~n       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      hostlev_china:core_inter~d       -0.0000        0.0000        0.0000        0.0000        0.0000 
      
      ------------------------------------------------------------------------------------- 
      
      Complete dominance designation 
      
      ------------------------------------------------------------------------------------- 
      
       
      
                                 dominated?:   dominated?:   dominated?:   dominated?:   dominated?: 
      
                               total_legi~y  leadership~r  1_capabili~e  1_system_e~n  core_inter~d 
      
      dominates?:total_legi~y             0 
      
      dominates?:leadership~r             0             0 
      
      dominates?:1_capabili~e             0             0             0 
      
      dominates?:1_system_e~n             0             0             0             0 
      
      dominates?:core_inter~d             0             0             0             0             0 
      
      ------------------------------------------------------------------------------------- 
      
       
      
      Strongest dominance designations 
      
      
      .  
      
      end of do-file

      I tried to rewrite the code for the above problem, but I repeatedly received a syntax error.

      Code:
       
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp" 
      
        
      
      . global ylist hostlev_china 
      
        
      
      . global xlist total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighte 
      
      > d 
      
        
      
      .  
      
      . xtologit $ylist $xlist 
      
        
      
      Fitting comparison model: 
      
        
      
      Iteration 0:   log likelihood = -203850.52   
      
      Iteration 1:   log likelihood = -196614.62   
      
      Iteration 2:   log likelihood = -196569.64   
      
      Iteration 3:   log likelihood =  -196569.6   
      
      Iteration 4:   log likelihood =  -196569.6   
      
        
      
      Refining starting values: 
      
        
      
      Grid node 0:   log likelihood =  -196380.5 
      
        
      
      Fitting full model: 
      
        
      
      Iteration 0:   log likelihood =  -196380.5  (not concave) 
      
      Iteration 1:   log likelihood = -196267.95  (not concave) 
      
      Iteration 2:   log likelihood = -196228.98  (not concave) 
      
      Iteration 3:   log likelihood = -196189.02  (not concave) 
      
      Iteration 4:   log likelihood = -196171.21  (not concave) 
      
      Iteration 5:   log likelihood = -196155.85  (not concave) 
      
      Iteration 6:   log likelihood = -196143.72   
      
      Iteration 7:   log likelihood = -196134.62   
      
      Iteration 8:   log likelihood = -196128.53   
      
      Iteration 9:   log likelihood = -196128.51   
      
      Iteration 10:  log likelihood = -196128.51   
      
        
      
      Random-effects ordered logistic regression      Number of obs     =    152,496 
      
      Group variable: group_id                        Number of groups  =        163 
      
        
      
      Random effects u_i ~ Gaussian                   Obs per group: 
      
                                                                    min =         37 
      
                                                                    avg =      935.6 
      
                                                                    max =     28,525 
      
        
      
      Integration method: mvaghermite                 Integration pts.  =         12 
      
        
      
                                                      Wald chi2(5)      =   12121.58 
      
      Log likelihood  = -196128.51                    Prob > chi2       =     0.0000 
      
        
      
      -------------------------------------------------------------------------------------------- 
      
                   hostlev_china |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval] 
      
      ---------------------------+---------------------------------------------------------------- 
      
                total_legitimacy |  -.2433826   .0023828  -102.14   0.000    -.2480527   -.2387125 
      
                leadership_power |  -.0524987   .0010566   -49.69   0.000    -.0545695   -.0504278 
      
      1.capability_preponderance |  -.3466504   .0720078    -4.81   0.000    -.4877831   -.2055176 
      
      1.system_effects_isolation |  -.0813809   .0155824    -5.22   0.000    -.1119218     -.05084 
      
         core_interests_weighted |   .0589856   .0110868     5.32   0.000     .0372559    .0807153 
      
      ---------------------------+---------------------------------------------------------------- 
      
                           /cut1 |  -2.918554   .0739506                     -3.063495   -2.773614 
      
                           /cut2 |  -2.746528   .0739195                     -2.891408   -2.601649 
      
                           /cut3 |  -1.584418    .073715                     -1.728897    -1.43994 
      
                           /cut4 |   1.212025   .0738174                      1.067345    1.356704 
      
      ---------------------------+---------------------------------------------------------------- 
      
                       /sigma2_u |   .0104084    .001931                      .0072355    .0149727 
      
      -------------------------------------------------------------------------------------------- 
      
      LR test vs. ologit model: chibar2(01) = 882.17        Prob >= chibar2 = 0.0000 
      
        
      
      .  
      
      end of do-file 
      
       
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp" 
      
        
      
      . domme (2.hostlev_china = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_inter 
      
      > ests_weighted) (3.hostlev_china = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation c 
      
      > ore_interests_weighted) (4.hostlev_china = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_is 
      
      > olation core_interests_weighted) (5.hostlev_china = total_legitimacy leadership_power 1.capability_preponderance 1.system_e 
      
      > ffects_isolation core_interests_weighted), reg(xtologit hostlev_china = total_legitimacy leadership_power i.capability_prep 
      
      > onderance i.system_effects_isolation core_interests_weighted) fitstat(e(), mcf) 
      
      xtologit hostlev_china = total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interes 
      
      > ts_weighted resulted in an error. 
      
      r(198);  
      
      end of do-file

      Finally, here is the code I used to perform dominance analysis with my xtstreg model.

      Code:
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp"
      
      . tsset group_id seqnum
             panel variable:  group_id (unbalanced)
              time variable:  seqnum, 1 to 29318
                      delta:  1 unit
      
      . tsspell event_use_of_force
      
      . 
      . global time _seq 
      
      . global event event_use_of_force
      
      . global xlist total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighte
      > d
      
      . 
      . xtset $event_use_of_force 
             panel variable:  group_id (unbalanced)
              time variable:  seqnum, 1 to 29318
                      delta:  1 unit
      
      . stset $time, failure ($event)
      
           failure event:  event_use_of_force != 0 & event_use_of_force < .
      obs. time interval:  (0, _seq]
       exit on or before:  failure
      
      ------------------------------------------------------------------------------
          156,790  total observations
                0  exclusions
      ------------------------------------------------------------------------------
          156,790  observations remaining, representing
           74,657  failures in single-record/single-failure data
         13114418  total analysis time at risk and under observation
                                                      at risk from t =         0
                                           earliest observed entry t =         0
                                                last observed exit t =     4,918
      
      . 
      end of do-file
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp"
      
      . xtstreg $xlist [fweight=use_of_force], dist (weibull) 
      
               failure _d:  event_use_of_force
         analysis time _t:  _seq
      
      Fitting comparison model:
      
      Iteration 0:   log likelihood =  -11488739  
      Iteration 1:   log likelihood = -212300.02  
      Iteration 2:   log likelihood = -183716.49  
      Iteration 3:   log likelihood = -174004.25  
      Iteration 4:   log likelihood =  -173744.1  
      Iteration 5:   log likelihood = -173743.21  
      Iteration 6:   log likelihood = -173743.21  
      
      Refining starting values:
      
      Grid node 0:   log likelihood = -173190.74
      
      Fitting full model:
      
      Iteration 0:   log likelihood = -173190.74  (not concave)
      Iteration 1:   log likelihood = -173113.24  (not concave)
      Iteration 2:   log likelihood = -173081.79  (not concave)
      Iteration 3:   log likelihood = -173052.92  (not concave)
      Iteration 4:   log likelihood = -173027.08  (not concave)
      Iteration 5:   log likelihood =  -173016.5  
      Iteration 6:   log likelihood = -172992.38  
      Iteration 7:   log likelihood = -172893.07  
      Iteration 8:   log likelihood = -172892.86  
      Iteration 9:   log likelihood = -172892.86  
      
      Random-effects Weibull PH regression            Number of obs     =     72,401
      Group variable:        group_id                 Number of groups  =        164
      
                                                      Obs per group:
                                                                    min =          5
                                                                    avg =      441.5
                                                                    max =      9,881
      
      Integration method: mvaghermite                 Integration pts.  =         12
      
                                                      Wald chi2(5)      =   13034.21
      Log likelihood = -172892.86                     Prob > chi2       =     0.0000
      --------------------------------------------------------------------------------------------
                              _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
      ---------------------------+----------------------------------------------------------------
                total_legitimacy |   1.160079   .0020358    84.61   0.000     1.156096    1.164076
                leadership_power |   1.022544   .0010493    21.73   0.000      1.02049    1.024603
      1.capability_preponderance |   1.911463   .1366571     9.06   0.000     1.661539     2.19898
      1.system_effects_isolation |   2.342492   .0323511    61.64   0.000     2.279935    2.406765
         core_interests_weighted |   .9891037    .009565    -1.13   0.257     .9705333     1.00803
                           _cons |   .0785017   .0058444   -34.18   0.000     .0678434    .0908344
      ---------------------------+----------------------------------------------------------------
                           /ln_p |  -.1154364   .0025781                     -.1204894   -.1103835
      ---------------------------+----------------------------------------------------------------
                       /sigma2_u |   .0505737   .0064467                      .0393932    .0649274
      --------------------------------------------------------------------------------------------
      Note: Estimates are transformed only in the first equation.
      Note: _cons estimates baseline hazard (conditional on zero random effects).
      LR test vs. Weibull model: chibar2(01) = 1700.70      Prob >= chibar2 = 0.0000
      
      . 
      end of do-file
      
      . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp"
      
      . domme ($event = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interests_weig
      > hted), reg(xtstreg $xlist [fweight=use_of_force]) fitstat(e(), est)
      xtstreg total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted [fwei
      > ght=use_of_force] resulted in an error.
      r(198);
      
      end of do-file

      Comment


      • #4
        My apologies, Joseph.

        Please disregard my previous post concerning my problems with using domme with xtlogit and xtologit models. I have figured out what the issue was - a rookie mistake.

        However, if you could help me to understand how to use domme to test for dominance among predictors using xtstreg (see previous post), I will be grateful.

        Best,

        Ray

        Comment


        • #5
          Hi again Ray,

          I corrected the issue with the code and ran my five models. Two of the models using xtlogit produced what appear to be accurate results. However, one model using xtlogit and another using xtologit produced very confusing results, which I think is indicative of a problem -- I assume it is not normal for results to show that all predictor variables have the same dominance statistic. I have included the code and results below and was wondering if you might know what the issue could be.
          You are right. It is not and is usually indicative of the parameter submitted to -domme- not being a parameter that is returned by the model. That is the case with the -xtstreg- model as well.

          For example, this model (from the Stata examples/helpfile):

          Code:
          . webuse catheter, clear
          (Kidney data, McGilchrist and Aisbett, Biometrics, 1991)
          
          . xtset patient
          
          Panel variable: patient (balanced)
          
          . xtstreg age female, distribution(weibull)
          
                  Failure _d: infect
            Analysis time _t: time
          
          Fitting comparison model:
          
          Iteration 0:   log likelihood = -1700989.9  
          Iteration 1:   log likelihood =  -440.1998  
          Iteration 2:   log likelihood = -336.62162  
          Iteration 3:   log likelihood = -334.64937  
          Iteration 4:   log likelihood = -334.57959  
          Iteration 5:   log likelihood = -334.57944  
          Iteration 6:   log likelihood = -334.57944  
          
          Refining starting values:
          
          Grid node 0:   log likelihood = -336.03903
          
          Fitting full model:
          
          Iteration 0:   log likelihood = -336.03903  (not concave)
          Iteration 1:   log likelihood = -333.12188  
          Iteration 2:   log likelihood = -330.38629  
          Iteration 3:   log likelihood = -329.89525  
          Iteration 4:   log likelihood = -329.87946  
          Iteration 5:   log likelihood = -329.87938  
          Iteration 6:   log likelihood = -329.87938  
          
          Random-effects Weibull PH regression            Number of obs     =         76
          Group variable: patient                         Number of groups  =         38
          
                                                          Obs per group:
                                                                        min =          2
                                                                        avg =        2.0
                                                                        max =          2
          
          Integration method: mvaghermite                 Integration pts.  =         12
          
                                                          Wald chi2(2)      =      10.17
          Log likelihood = -329.87938                     Prob > chi2       =     0.0062
          ------------------------------------------------------------------------------
                    _t | Haz. ratio   Std. err.      z    P>|z|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                   age |   1.007329   .0137828     0.53   0.594     .9806742    1.034708
                female |   .1910581   .0999004    -3.17   0.002     .0685629    .5324042
                 _cons |   .0073346   .0072307    -4.99   0.000     .0010623    .0506427
          -------------+----------------------------------------------------------------
                 /ln_p |    .222825   .1386296                     -.0488841     .494534
          -------------+----------------------------------------------------------------
             /sigma2_u |   .8234583   .4812598                      .2619194    2.588902
          ------------------------------------------------------------------------------
          Note: Estimates are transformed only in the first equation to hazard ratios.
          Note: _cons estimates baseline hazard (conditional on zero random effects).
          LR test vs. Weibull model: chibar2(01) = 9.40         Prob >= chibar2 = 0.0011
          produces coeffient names that look like:

          Code:
          . matrix list e(b)
          
          e(b)[1,5]
                      _t:         _t:         _t:          /:          /:
                     age      female       _cons        ln_p    sigma2_u
          y1   .00730219  -1.6551777  -4.9151482   .22282497   .82345832
          Thus to make them work, the equation name must be -_t- as that is the way survival models name parameters.

          Specifically:

          Code:
          . domme (_t = age female), reg(xtstreg age female) ropt(distribution(weibull)) fitstat(e(), est)
          
          Total of 3 models/regressions
          
          General dominance statistics: Random-effects Weibull PH regression
          Number of obs             =                      76
          Overall Fit Statistic     =                  0.1412
          
                      |      Dominance      Standardized      Ranking
                      |      Stat.          Domin. Stat.
          ------------+------------------------------------------------------------------------
          _t          |
           age        |         0.0031      0.0222            2 
           female     |         0.1381      0.9778            1 
          -------------------------------------------------------------------------------------
          Conditional dominance statistics
          -------------------------------------------------------------------------------------
          
                      #param_ests:  #param_ests:
                                1             2
             _t:age        0.0030        0.0033
          _t:female        0.1379        0.1383
          -------------------------------------------------------------------------------------
          Complete dominance designation
          -------------------------------------------------------------------------------------
          
                              dominated?:  dominated?:
                                     age       female
             dominates?:age            0           -1
          dominates?:female            1            0
          -------------------------------------------------------------------------------------
          
          Strongest dominance designations
          
          _t:female completely dominates _t:age
          By contrast, if I accidentally name the equation -_b-, I get a result similar to what you were posting before:

          Code:
          . domme (_b = age female), reg(xtstreg age female) ropt(distribution(weibull)) fitstat(e(), est)
          
          Total of 3 models/regressions
          
          General dominance statistics: Random-effects Weibull PH regression
          Number of obs             =                      76
          Overall Fit Statistic     =                  0.0000
          
                      |      Dominance      Standardized      Ranking
                      |      Stat.          Domin. Stat.
          ------------+------------------------------------------------------------------------
          _b          |
           age        |         0.0000      0.5000            1 
           female     |         0.0000      0.5000            1 
          -------------------------------------------------------------------------------------
          Conditional dominance statistics
          -------------------------------------------------------------------------------------
          
                      #param_ests:  #param_ests:
                                1             2
             _b:age        0.0000        0.0000
          _b:female        0.0000        0.0000
          -------------------------------------------------------------------------------------
          Complete dominance designation
          -------------------------------------------------------------------------------------
          
                              dominated?:  dominated?:
                                     age       female
             dominates?:age            0
          dominates?:female            0            0
          -------------------------------------------------------------------------------------
          
          Strongest dominance designations
          The models will all run, but there is no dominance designation possible as none of the predictors are set to 0 across all subsets (as their names are wrong); which makes all the parameters look like they have no contribution (and that the fit statistic is 0).
          Joseph Nicholas Luchman, Ph.D., PStat® (American Statistical Association)
          ----
          Research Fellow
          Fors Marsh

          ----
          Version 18.0 MP

          Comment


          • #6
            Hello Joseph,

            I really appreciate you taking the time to help me through this. I ran the Weibull distribution again. See results below. However, I was unable to get the domme command syntax to work properly.

            Code:
            . do "C:\Users\Sunyoung\AppData\Local\Temp\STD51c4_000000.tmp"
            
            . tsset group_id seqnum
                   panel variable:  group_id (unbalanced)
                    time variable:  seqnum, 1 to 29318
                            delta:  1 unit
            
            . tsspell event_use_of_force
            
            .
            . global time _seq
            
            . global event event_use_of_force
            
            . global xlist total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighte
            > d
            
            .
            . xtset $event_use_of_force
                   panel variable:  group_id (unbalanced)
                    time variable:  seqnum, 1 to 29318
                            delta:  1 unit
            
            . stset $time, failure ($event)
            
                 failure event:  event_use_of_force != 0 & event_use_of_force < .
            obs. time interval:  (0, _seq]
             exit on or before:  failure
            
            ------------------------------------------------------------------------------
                156,790  total observations
                      0  exclusions
            ------------------------------------------------------------------------------
                156,790  observations remaining, representing
                 74,657  failures in single-record/single-failure data
               13120936  total analysis time at risk and under observation
                                                            at risk from t =         0
                                                 earliest observed entry t =         0
                                                      last observed exit t =     4,919
            
            .
            . * When running xtstreg, recieved error message (r1400) "initial values not feasible". numerical overflow - You have attempt
            > ed something that, in the midst of the necessary calculations, has resulted in something too large for Stata to deal with a
            > ccurately.  Most commonly, this is an attempt to estimate a model (say, with regress) with too many effective observations.
            >   This effective number could be reached with far fewer observations if you were running a frequency-weighted model. Stata
            > suggests using frequency weights (fweight) to address the issue.
            .
            . xtstreg $xlist [fweight=use_of_force], dist (weibull)
            
                     failure _d:  event_use_of_force
               analysis time _t:  _seq
            
            Fitting comparison model:
            
            Iteration 0:   log likelihood =  -11528155  
            Iteration 1:   log likelihood = -213600.91  
            Iteration 2:   log likelihood = -184520.74  
            Iteration 3:   log likelihood = -174040.62  
            Iteration 4:   log likelihood = -173729.38  
            Iteration 5:   log likelihood = -173728.67  
            Iteration 6:   log likelihood = -173728.67  
            
            Refining starting values:
            
            Grid node 0:   log likelihood = -173167.79
            
            Fitting full model:
            
            Iteration 0:   log likelihood = -173167.79  (not concave)
            Iteration 1:   log likelihood = -173090.46  (not concave)
            Iteration 2:   log likelihood = -173059.03  (not concave)
            Iteration 3:   log likelihood = -173030.18  (not concave)
            Iteration 4:   log likelihood = -173004.32  (not concave)
            Iteration 5:   log likelihood = -172993.66  
            Iteration 6:   log likelihood = -172983.87  (backed up)
            Iteration 7:   log likelihood = -172867.36  
            Iteration 8:   log likelihood = -172865.19  
            Iteration 9:   log likelihood = -172865.11  
            Iteration 10:  log likelihood = -172865.11  
            
            Random-effects Weibull PH regression            Number of obs     =     72,401
            Group variable:        group_id                 Number of groups  =        164
            
                                                            Obs per group:
                                                                          min =          5
                                                                          avg =      441.5
                                                                          max =      9,881
            
            Integration method: mvaghermite                 Integration pts.  =         12
            
                                                            Wald chi2(5)      =   13074.43
            Log likelihood = -172865.11                     Prob > chi2       =     0.0000
            --------------------------------------------------------------------------------------------
                                    _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
            ---------------------------+----------------------------------------------------------------
                      total_legitimacy |   1.163914   .0020472    86.30   0.000     1.159908    1.167933
                      leadership_power |   1.023555   .0010467    22.77   0.000     1.021506    1.025609
            1.capability_preponderance |   1.971447   .1410727     9.49   0.000     1.713463    2.268273
            1.system_effects_isolation |    2.33814   .0322503    61.58   0.000     2.275778    2.402212
               core_interests_weighted |   1.056645   .0101997     5.71   0.000     1.036841    1.076826
                                 _cons |   .0708518    .005279   -35.53   0.000     .0612251    .0819921
            ---------------------------+----------------------------------------------------------------
                                 /ln_p |  -.1139759    .002581                     -.1190345   -.1089173
            ---------------------------+----------------------------------------------------------------
                             /sigma2_u |   .0499284   .0063757                      .0388734    .0641273
            --------------------------------------------------------------------------------------------
            Note: Estimates are transformed only in the first equation.
            Note: _cons estimates baseline hazard (conditional on zero random effects).
            LR test vs. Weibull model: chibar2(01) = 1727.11      Prob >= chibar2 = 0.0000
            
            .
            end of do-file
            After running the Weibull regression, I typed the following command.

            Code:
            domme (_t = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interests_weighted [fweight=use_of_force]), reg(xtstreg total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted [fweight=use_of_force]) ropt(distribution(weibull)) fitstat(e(), est)
            However, I end up getting the error message "variable _cons not found". I am not sure what I have done wrong. Any thoughts?

            Thanks again for you help!
            Last edited by Ray Hartman; 04 Oct 2022, 05:19.

            Comment


            • #7
              Hi again Ray,

              The weights only need to be be submitted to -domme- once and in it's standard syntax/before the comma. No need to submit it in the -reg()- option.

              The parenthetical statements submitted to -domme- are used to parse parameters not unlike -sureg- or -[g]sem- and the weight statement should be outside the parenthetical statements there as well. Can't speak to the specific error reported here but suspect it has to do with the way the weights are included at current.

              - joe
              Joseph Nicholas Luchman, Ph.D., PStat® (American Statistical Association)
              ----
              Research Fellow
              Fors Marsh

              ----
              Version 18.0 MP

              Comment


              • #8
                Hello Joe,

                According to your instructions, I should type the syntax as below, right? However, when I do this, I still get the "variable _cons not found" error message. Could you confirm that I have written the syntax properly for the domme command?

                Thank you.

                Code:
                 
                 domme (_t = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interests_weighted) [fweight=use_of_force], reg(xtstreg total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted) ropt(distribution(weibull)) fitstat(e(), est)

                Comment


                • #9
                  Hi again Ray,

                  Again, can't speak to the specific error received as it is not obvious to me why Stata believes you've noted there is a variable named -_cons-.

                  The code looks reasonable to me given the model you presented above.

                  It is worth noting that -domme- does not do any explicit -varlist- checks and, if variables are specified and an error occurs with the underlying command, it would produce an error like:

                  Code:
                  xtstreg total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted resulted in an error.
                  r(111);
                  That is, it would report back a general error with the error code the command made (which would point to variables not being defined).

                  Any errors related to variables that -domme- reports back, like is implied here, would presumably come from checks against the weight.
                  Joseph Nicholas Luchman, Ph.D., PStat® (American Statistical Association)
                  ----
                  Research Fellow
                  Fors Marsh

                  ----
                  Version 18.0 MP

                  Comment


                  • #10
                    Thanks so much, Joe! You have been a huge help.

                    Comment

                    Working...
                    X