Announcement

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

  • Testing after margins, post

    Hoping someone can help me understand an issue with using test after margins, post.

    I run the following regression, with the ultimate aim of knowing whether the effect of OM varies meaningfully with the value of IPcont.


    Code:
    . regress Opp $controls ib0.csDum c.IPcont  OM BM Sol  c.IPcont#c.OM, robust
    
    --------------------------------------------------------------------------------------------
                               |               Robust
                           Opp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------------------+----------------------------------------------------------------
                       depAsym |  -.0121849   .0275436    -0.44   0.659    -.0667485    .0423786
                        volUnc |   .0653512   .0494453     1.32   0.189    -.0325996     .163302
                        tecUnc |  -.1130619   .0964371    -1.17   0.243    -.3041031    .0779794
                       perfAmb |   .2317594   .0863513     2.68   0.008     .0606981    .4028206
                         prior |   .0173488   .0850643     0.20   0.839     -.151163    .1858605
                     localSupp |    .163849   .1866408     0.88   0.382     -.205885    .5335829
                     noExtSupp |   .0056782   .0084204     0.67   0.501    -.0110026    .0223591
                  emplMARKUSln |   .1257304   .0781502     1.61   0.110    -.0290846    .2805454
                               |
                           INP |
                      Input 1  |  -.0157771    .334995    -0.05   0.963    -.6793996    .6478455
                      Input 3  |  -.1744805   .3404611    -0.51   0.609    -.8489313    .4999703
                               |
              contractSpecMean |   .0300773   .0590932     0.51   0.612    -.0869859    .1471404
                               |
                         csDum |
    Concurrent sourcing dummy  |   .2245481   .2263385     0.99   0.323    -.2238266    .6729229
                        IPcont |   .0237525   .0134547     1.77   0.080    -.0029012    .0504062
                            OM |   .1582368   .0675551     2.34   0.021     .0244106    .2920629
                            BM |  -.0370055   .0642838    -0.58   0.566    -.1643513    .0903403
                           Sol |  -.4137848   .0793497    -5.21   0.000     -.570976   -.2565937
                               |
                 c.IPcont#c.OM |  -.0047667   .0020494    -2.33   0.022    -.0088266   -.0007067
                               |
                         _cons |   1.929306   .9005282     2.14   0.034     .1453665    3.713246
    --------------------------------------------------------------------------------------------
    Following the directions in the entry for margins, I run this margins command including the post option.

    Code:
    . margins, dydx(OM) at(IPcont=(0 17.5 37.5 62.5 82.5)) post
    
    Expression   : Linear prediction, predict()
    dy/dx w.r.t. : OM
    
    1._at        : IPcont          =           0
    2._at        : IPcont          =        17.5
    3._at        : IPcont          =        37.5
    4._at        : IPcont          =        62.5
    5._at        : IPcont          =        82.5
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    OM           |
             _at |
              1  |   .1582368   .0675551     2.34   0.021     .0244106    .2920629
              2  |   .0748203   .0623266     1.20   0.232    -.0486482    .1982887
              3  |  -.0205129   .0791117    -0.26   0.796    -.1772326    .1362069
              4  |  -.1396793   .1181164    -1.18   0.239     -.373667    .0943084
              5  |  -.2350124   .1545508    -1.52   0.131    -.5411763    .0711514
    ------------------------------------------------------------------------------
    I've checked that the values for dy/dx are what manual calculation of 0.15 + IPcont * _b[c.IPcont#c.OM] gives. Based on the strongly overlapping 95% CI, I wouldn't expect the difference between IPcont = 0 and IPcont = 17.5 to be significant. However, the difference between IPcont = 0 and IPcont = 82.5 might be.

    I use margins, coefl to get the names of the coefficient and then do the tests corresponding to the above.


    Code:
    . margins, coefl
    
    Average marginal effects                        Number of obs     =        132
    Model VCE    : Robust
    
    Expression   : Linear prediction, predict()
    dy/dx w.r.t. : OM
    
    1._at        : IPcont          =           0
    
    2._at        : IPcont          =        17.5
    
    3._at        : IPcont          =        37.5
    
    4._at        : IPcont          =        62.5
    
    5._at        : IPcont          =        82.5
    
    ------------------------------------------------------------------------------
                 |      dy/dx  Legend
    -------------+----------------------------------------------------------------
    OM           |
             _at |
              1  |   .1582368  _b[OM:1bn._at]
              2  |   .0748203  _b[OM:2._at]
              3  |  -.0205129  _b[OM:3._at]
              4  |  -.1396793  _b[OM:4._at]
              5  |  -.2350124  _b[OM:5._at]
    ------------------------------------------------------------------------------
    
    . test _b[OM:1bn._at] = _b[OM:2._at]
    
     ( 1)  [OM]1bn._at - [OM]2._at = 0
    
           F(  1,   114) =    5.41
                Prob > F =    0.0218
    
    . test _b[OM:1bn._at] = _b[OM:5._at]
    
     ( 1)  [OM]1bn._at - [OM]5._at = 0
    
           F(  1,   114) =    5.41
                Prob > F =    0.0218
    Two very odd things result. First, I don't believe that [OM]1bn._at and [OM]2._at = 0 differ at the 0.0218 level. Second, I get exactly the same values when testing for the difference [OM]1bn._at - [OM]5._at = 0. That should NOT be the case if I've tested what I think I've tested.

    So, I'm baffled and concerned that I'm not testing what I intend. Can anyone help me properly test whether the marginal effect of OM differs when IPcont=0 versus when IPcont=82.5?

    Thank you.


    _______________________________________

    Glenn Hoetker
    Professor in Business Strategy

    Melbourne Business School, University of Melbourne
    200 Leicester Street, Carlton, Victoria 3053, Australia
    Email: [email protected]

    I acknowledge the Traditional Owners of the land on which I work, the Wurundjeri people of the Kulin Nations, and pay my respects to their Elders, past and present.
Working...
X