Announcement

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

  • De-mean Regressors in Panel Data Analysis with Interaction

    Dear all,

    First, my data:

    Code:
    input float(id month Y X1 X2)
    11630 740 0 2.061 2300
     2982 735 5 2.551 2431.6
    19647 736 0 2.394 9696.042
    15889 732 4 2.763 2137.8435
    10636 726 0 2.333 5437.80
     1281 739 3 2.134 2137.8435
     1312 737 0  2.28 4312.76
     3847 736 1 2.394 2137.8435
    15278 740 0 2.061 2408.54
     7169 726 2 2.333 10060.36
    19022 727 0 2.394 3876.9887
      877 734 1 2.612 2137.8435
     1164 746 0 1.838 2233.5
    19611 740 0 2.061 2137.8435
     1790 723 0 2.175 9696.043
    I have read multiple very relevant posts on this forum about the dangers of standard regressors when one has panel data, and the problems associated with it.

    Do these problems also apply to de-meaning? As in which mean to remove, the time mean, between mean or overall mean?

    My issue is the following: I would like to run something like

    Code:
    reg Y X1 X2 X1*X2 +FE + error
    I am mainly interested in the interaction term, however I need to interpret the "baseline" effects of X1 and X2 as well. If I were to de-mean the data and this were cross-sectional data, the coefficient on X1 (X2) would be its impact on Y when X1 (X2) is set to its mean.

    The classical interpretation is the impact of e.g. X1 on Y when X2 is set to 0, correct? The problem is, in this configuration, 0 would be a completely unrealistic value for X1 and X2...

    Does anyone have any recommendations to aid the interpretation of baseline effects in panel data with continuous regressors and an interaction?

    Many thanks in advance!

  • #2
    Why not just use margins?

    Code:
    webuse grunfeld, clear
    regress invest c.mvalue##c.kstock i.company
    margins, dydx(mvalue kstock)
    Res.:

    Code:
     
    . regress invest c.mvalue##c.kstock i.company
    
          Source |       SS           df       MS      Number of obs   =       200
    -------------+----------------------------------   F(12, 187)      =    399.08
           Model |  9008187.37        12  750682.281   Prob > F        =    0.0000
        Residual |   351756.55       187  1881.05107   R-squared       =    0.9624
    -------------+----------------------------------   Adj R-squared   =    0.9600
           Total |  9359943.92       199  47034.8941   Root MSE        =    43.371
    
    -----------------------------------------------------------------------------------
               invest | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    ------------------+----------------------------------------------------------------
               mvalue |   .0698811   .0106165     6.58   0.000     .0489376    .0908245
               kstock |    .071638   .0287433     2.49   0.014     .0149352    .1283407
                      |
    c.mvalue#c.kstock |   .0000617   6.46e-06     9.55   0.000     .0000489    .0000744
                      |
              company |
                   2  |   144.3973   25.77688     5.60   0.000      93.5464    195.2481
                   3  |  -181.5888   26.17275    -6.94   0.000    -233.2206    -129.957
                   4  |  -47.43332   37.29734    -1.27   0.205    -121.0109    26.14429
                   5  |  -67.83132   41.57352    -1.63   0.104    -149.8447    14.18205
                   6  |  -55.84243   39.95575    -1.40   0.164    -134.6644    22.97952
                   7  |  -59.26622   42.08032    -1.41   0.161    -142.2794    23.74694
                   8  |  -85.18981   37.63082    -2.26   0.025    -159.4253   -10.95432
                   9  |  -80.07188   40.36941    -1.98   0.049    -159.7099   -.4338978
                  10  |  -73.23958   43.78092    -1.67   0.096    -159.6076     13.1284
                      |
                _cons |   70.91667    43.4471     1.63   0.104    -14.79277    156.6261
    -----------------------------------------------------------------------------------
    
    . 
    . margins, dydx(mvalue kstock)
    
    Average marginal effects                                   Number of obs = 200
    Model VCE: OLS
    
    Expression: Linear prediction, predict()
    dy/dx wrt:  mvalue kstock
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          mvalue |   .0869056   .0100437     8.65   0.000     .0670921    .1067191
          kstock |   .1383553   .0229442     6.03   0.000     .0930926    .1836181
    ------------------------------------------------------------------------------
    
    .

    Comment

    Working...
    X