Announcement

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

  • Assistance with calculating Marginal Effects

    Hello,

    Stata 14.1 user here! I am currently writing about the effect that sovereign credit rating actions have on the ratings of banks.

    Dependent variable:
    BDNn - bank is downgraded n notches (n=0,1,2,3)

    Independent variables:
    SDN_1 - sovereign is downgraded 1 notch (0 or 1)
    SDN_2 - sovereign is downgraded 2 notches (0 or 1)
    SDN_3 - sovereign is downgraded 3 or more notches (0 or 1)
    SUP_1 - sovereign is upgraded 1 notch (0 or 1)
    SNWQ - sovereign is on negative watch (0 or 1)
    SPWQ - sovereign is on positive watch (0 or 1)
    Sovereign rating - control var (from 1 to 24)

    There are more variables and multiple versions but this is the 'simpler' version of the model. My initial code is:

    xtset ID_number Date
    xtologit BDNn SDN_1 SDN_2 SDN_3 SUP_1 SNWQ SPWQ SovereignRating

    What I want to known is if SDN_1=1 what the likelihood of BDNn=1,2 or 3 or more notches is?

    From what I saw, I should use the margins command. In order to do that it seems I should identify my dummy variables as categorical:

    Code:
    . xtologit BDNn i.SDN_1 i.SDN_2 i.SDN_3 i.SUP_1 i.SNWQ i.SPWQ SovereignRating
    
    Fitting comparison model:
    
    Iteration 0:   log likelihood = -4900.4703  
    Iteration 1:   log likelihood = -4556.0509  
    Iteration 2:   log likelihood = -4497.6561  
    Iteration 3:   log likelihood = -4485.8624  
    Iteration 4:   log likelihood = -4485.7416  
    Iteration 5:   log likelihood = -4485.7374  
    Iteration 6:   log likelihood = -4485.7371  
    Iteration 7:   log likelihood = -4485.7371  
    
    Refining starting values:
    
    Grid node 0:   log likelihood =  -4577.397
    
    Fitting full model:
    
    Iteration 0:   log likelihood =  -4577.397  (not concave)
    Iteration 1:   log likelihood = -4491.5689  
    Iteration 2:   log likelihood = -4483.3882  
    Iteration 3:   log likelihood = -4482.3499  
    Iteration 4:   log likelihood = -4482.3486  
    Iteration 5:   log likelihood = -4482.3486  
    
    Random-effects ordered logistic regression      Number of obs     =      5,822
    Group variable: ID_number                       Number of groups  =      2,016
    
    Random effects u_i ~ Gaussian                   Obs per group:
                                                                  min =          1
                                                                  avg =        2.9
                                                                  max =         21
    
    Integration method: mvaghermite                 Integration pts.  =         12
    
                                                    Wald chi2(7)      =     640.84
    Log likelihood  = -4482.3486                    Prob > chi2       =     0.0000
    
    ---------------------------------------------------------------------------------
               BDNn |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
                    |
            1.SDN_1 |   1.282189   .1026812    12.49   0.000     1.080937     1.48344
            1.SDN_2 |    1.55724   .1463606    10.64   0.000     1.270378    1.844101
            1.SDN_3 |   3.002522   .2455032    12.23   0.000     2.521345      3.4837
            1.SUP_1 |  -2.525022   .3708289    -6.81   0.000    -3.251833   -1.798211
             1.SNWQ |  -1.916259   .1896509   -10.10   0.000    -2.287968    -1.54455
             1.SPWQ |  -18.92281   17955.19    -0.00   0.999    -35210.45    35172.61
    SovereignRating |   .0262496   .0090356     2.91   0.004     .0085401     .043959
    ----------------+----------------------------------------------------------------
              /cut1 |    .989602    .049952    19.81   0.000     .8916979    1.087506
              /cut2 |   2.977047   .0744732    39.97   0.000     2.831082    3.123012
              /cut3 |   4.301772   .1079608    39.85   0.000     4.090173    4.513372
    ----------------+----------------------------------------------------------------
          /sigma2_u |   .1130177   .0491958                      .0481531    .2652582
    ---------------------------------------------------------------------------------
    LR test vs. ologit model: chibar2(01) = 6.78          Prob >= chibar2 = 0.0046
    Is this correct to assume? Now onto the margins code. I first did margins, dydx(*)

    Code:
    .  margins, dydx(*)
    
    Average marginal effects                        Number of obs     =      5,822
    Model VCE    : OIM
    
    dy/dx w.r.t. : 1.SDN_1 1.SDN_2 1.SDN_3 1.SUP_1 1.SNWQ 1.SPWQ SovereignRating
    1._predict   : Pr(0.BDNn), predict(pr outcome(0))
    2._predict   : Pr(1.BDNn), predict(pr outcome(1))
    3._predict   : Pr(2.BDNn), predict(pr outcome(2))
    4._predict   : Pr(3.BDNn), predict(pr outcome(3))
    
    ---------------------------------------------------------------------------------
                    |            Delta-method
                    |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
    1.SDN_1         |
           _predict |
                 1  |  -.2684081   .0218655   -12.28   0.000    -.3112637   -.2255526
                 2  |   .1566434   .0108431    14.45   0.000     .1353912    .1778955
                 3  |   .0712929   .0080412     8.87   0.000     .0555325    .0870534
                 4  |   .0404718   .0055584     7.28   0.000     .0295776     .051366
    ----------------+----------------------------------------------------------------
    1.SDN_2         |
           _predict |
                 1  |  -.3235553   .0297191   -10.89   0.000    -.3818037   -.2653068
                 2  |   .1673386   .0100742    16.61   0.000     .1475936    .1870836
                 3  |   .0965402   .0130516     7.40   0.000     .0709596    .1221208
                 4  |   .0596764   .0101186     5.90   0.000     .0398443    .0795086
    ----------------+----------------------------------------------------------------
    1.SDN_3         |
           _predict |
                 1  |  -.5485901   .0277538   -19.77   0.000    -.6029866   -.4941937
                 2  |   .1052249   .0261592     4.02   0.000     .0539539    .1564959
                 3  |   .2171439   .0180633    12.02   0.000     .1817404    .2525474
                 4  |   .2262213   .0396679     5.70   0.000     .1484737     .303969
    ----------------+----------------------------------------------------------------
    1.SUP_1         |
           _predict |
                 1  |   .2702918   .0164749    16.41   0.000     .2380016     .302582
                 2  |  -.2042009   .0137561   -14.84   0.000    -.2311623   -.1772394
                 3  |   -.045458   .0032109   -14.16   0.000    -.0517512   -.0391648
                 4  |  -.0206329   .0018991   -10.86   0.000    -.0243551   -.0169107
    ----------------+----------------------------------------------------------------
    1.SNWQ          |
           _predict |
                 1  |   .2471957   .0143714    17.20   0.000     .2190282    .2753631
                 2  |  -.1850587   .0118024   -15.68   0.000    -.2081909   -.1619264
                 3  |  -.0426171   .0030132   -14.14   0.000    -.0485229   -.0367114
                 4  |  -.0195199   .0017978   -10.86   0.000    -.0230436   -.0159962
    ----------------+----------------------------------------------------------------
    1.SPWQ          |
           _predict |
                 1  |   .3063149   .0063064    48.57   0.000     .2939546    .3186752
                 2  |  -.2350874   .0057033   -41.22   0.000    -.2462656   -.2239092
                 3  |  -.0492198   .0027646   -17.80   0.000    -.0546383   -.0438014
                 4  |  -.0220077   .0018719   -11.76   0.000    -.0256766   -.0183388
    ----------------+----------------------------------------------------------------
    SovereignRating |
           _predict |
                 1  |  -.0048165   .0016495    -2.92   0.004    -.0080495   -.0015835
                 2  |   .0032462   .0011103     2.92   0.003       .00107    .0054224
                 3  |   .0010353   .0003599     2.88   0.004     .0003299    .0017407
                 4  |    .000535   .0001895     2.82   0.005     .0001636    .0009064
    ---------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    but as per https://www.statalist.org/forums/for...nt-interaction the results may be meaningless. If not, then how would these be interpreted?

    Would doing margins, dydx(SDN_1) predict(pu0 outcome(1)) or margins, dydx(SDN_1) - for each independent variable - be better? Any other suggestion?

    Thank you very much in advance!







Working...
X