Announcement

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

  • Interaction effects and model selection (pooled OLS, FE, RE)

    Hello to all! I am facing the following problems with my panel data analysis:

    (1) I would like to create subgroups (currently two) in terms of age and check their interaction effects with another financial variable. For this purpose, I have created another age group variable via the recode command, which takes either the value 1 (first group) or 2 (second group), i.e. over and under 50 years. I would like to examine a similar interaction effect for years of service. However, when I run a simple regression, Stata does not show me a split for the subgroups. What can I do in this case to get usable results for both age categories?

    (2) Regarding the choice of fixed effects, random effects, or pooled effects model: Am I right in assuming that because I do not have an identical sample in each year due to missing data, a pooled ols tends to be more appropriate here?

    I have attached an excerpt from Stata and my data below. I appreciate any help!

    Code:
    recode ceo_age (min/50 = 1) (51/max = 2), gen(age_gp)
    tab age_gp
    recode ceo_tenure (min/3 = 1) (4/max = 2), gen(tenure_gp)
    tab tenure_gp
    Code:
    reg esg_score c.curetr c.curetr#age_gp intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_ten
    > ure i.year i.siccode, vce(r)
    
    Linear regression                               Number of obs     =        851
                                                    F(23, 827)        =      40.34
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.4384
                                                    Root MSE          =     13.398
    
    ---------------------------------------------------------------------------------
                    |               Robust
          esg_score |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
             curetr |  -4.400755   4.050604    -1.09   0.278    -12.35143    3.549919
                    |
    age_gp#c.curetr |
                 2  |   8.772016   3.238446     2.71   0.007     2.415475    15.12856
                    |
              intan |  -1.705206   5.018897    -0.34   0.734    -11.55648    8.146067
                lev |   6.247028   4.405853     1.42   0.157    -2.400942      14.895
           pb_ratio |  -.0245294   .0786188    -0.31   0.755    -.1788453    .1297865
             capint |    10.9656   4.537595     2.42   0.016     2.059042    19.87216
                roa |    24.8038    9.31881     2.66   0.008       6.5125     43.0951
               size |   6.171308   .3896329    15.84   0.000     5.406522    6.936094
         salary_gap |   .0251233   .0051702     4.86   0.000     .0149751    .0352715
              board |  -.2755872   1.125644    -0.24   0.807    -2.485042    1.933868
        ceo_duality |   3.043209   .9938728     3.06   0.002     1.092399    4.994019
             gender |   5.177933    1.81803     2.85   0.005     1.609437    8.746429
         ceo_tenure |  -.3893942   .0771052    -5.05   0.000    -.5407391   -.2380492
                    |
               year |
              2016  |   .6911621   1.603866     0.43   0.667    -2.456966     3.83929
              2017  |   1.324798    1.60296     0.83   0.409    -1.821551    4.471147
              2018  |   3.527925   1.531031     2.30   0.021     .5227619    6.533089
              2019  |   4.524673   1.533702     2.95   0.003     1.514266    7.535079
                    |
            siccode |
                 3  |   5.422113   2.910965     1.86   0.063    -.2916361    11.13586
                 4  |   6.625767    2.34169     2.83   0.005     2.029411    11.22212
                 5  |   .3659336   2.602472     0.14   0.888    -4.742294    5.474161
                 6  |   .1884965   3.168794     0.06   0.953    -6.031329    6.408322
                 7  |   2.610705    2.43528     1.07   0.284    -2.169353    7.390762
                 8  |  -.3438315   2.934011    -0.12   0.907    -6.102815    5.415152
                    |
              _cons |   -45.3922   7.452458    -6.09   0.000    -60.02015   -30.76424
    ---------------------------------------------------------------------------------
    Code:
    . vif
    
        Variable |       VIF       1/VIF  
    -------------+----------------------
          curetr |      1.98    0.503872
          age_gp#|
        c.curetr |
              2  |      2.04    0.490632
           intan |      1.54    0.650179
             lev |      1.47    0.679840
        pb_ratio |      1.62    0.618631
          capint |      1.82    0.549529
             roa |      2.09    0.478770
            size |      1.60    0.623381
      salary_gap |      1.28    0.779262
           board |      1.33    0.750410
     ceo_duality |      1.28    0.780442
          gender |      1.10    0.906361
      ceo_tenure |      1.17    0.858357
            year |
           2016  |      1.71    0.585061
           2017  |      1.81    0.553982
           2018  |      1.86    0.538775
           2019  |      1.88    0.533250
         siccode |
              3  |      2.12    0.471907
              4  |      7.74    0.129244
              5  |      3.66    0.273140
              6  |      2.11    0.474175
              7  |      3.30    0.302896
              8  |      6.44    0.155248
    -------------+----------------------
        Mean VIF |      2.30
    
    .

  • #2
    you need to include 2 hash marks, not just the one you actually put in; i.e., where you "c.curetr#age_gp", you should have "c.curetr##age_gp"; note that the question is not completely clear so this is my best guess; see
    Code:
    h fvvarlist

    Comment


    • #3
      Thank you! I have applied the change and hoped to get two different coefficients for the influence of age.

      I would like to show that the generally negative influence of the continuous financial variable differs depending on the age group to which the executive belongs. Now I got the following output:
      Code:
      . reg esg_score c.curetr##age_gp intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_tenure i.ye
      > ar i.siccode, vce(r)
      
      Linear regression                               Number of obs     =        851
                                                      F(24, 826)        =      38.77
                                                      Prob > F          =     0.0000
                                                      R-squared         =     0.4385
                                                      Root MSE          =     13.405
      
      ---------------------------------------------------------------------------------
                      |               Robust
            esg_score |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      ----------------+----------------------------------------------------------------
               curetr |  -2.689088   5.821337    -0.46   0.644    -14.11544    8.737266
             2.age_gp |   .9006086   2.473469     0.36   0.716    -3.954416    5.755633
                      |
      age_gp#c.curetr |
                   2  |   6.506266   6.767485     0.96   0.337    -6.777226    19.78976
                      |
                intan |  -1.781469   5.016168    -0.36   0.723     -11.6274    8.064466
                  lev |    6.33887   4.369675     1.45   0.147    -2.238102    14.91584
             pb_ratio |  -.0217364   .0792347    -0.27   0.784    -.1772614    .1337886
               capint |   10.91383   4.531687     2.41   0.016     2.018849     19.8088
                  roa |   24.88531   9.295931     2.68   0.008     6.638882    43.13174
                 size |   6.153849   .3860024    15.94   0.000     5.396188     6.91151
           salary_gap |   .0249771   .0052287     4.78   0.000      .014714    .0352401
                board |  -.2806724   1.127379    -0.25   0.803    -2.493538    1.932193
          ceo_duality |   3.063732   .9909795     3.09   0.002     1.118597    5.008866
               gender |   5.127804   1.823112     2.81   0.005     1.549327     8.70628
           ceo_tenure |  -.3930878   .0777844    -5.05   0.000    -.5457661   -.2404095
                      |
                 year |
                2016  |   .6562786   1.601332     0.41   0.682    -2.486879    3.799437
                2017  |   1.275072   1.599791     0.80   0.426    -1.865062    4.415206
                2018  |   3.503905   1.527639     2.29   0.022     .5053932    6.502416
                2019  |   4.486183   1.528451     2.94   0.003     1.486077    7.486289
                      |
              siccode |
                   3  |   5.452528   2.916654     1.87   0.062    -.2723979    11.17745
                   4  |   6.570393   2.335822     2.81   0.005     1.985549    11.15524
                   5  |   .3120088   2.613967     0.12   0.905    -4.818791    5.442808
                   6  |   .1436769   3.168292     0.05   0.964    -6.075173    6.362527
                   7  |   2.606018   2.429488     1.07   0.284    -2.162679    7.374716
                   8  |  -.4137037   2.924082    -0.14   0.888    -6.153208    5.325801
                      |
                _cons |  -45.69922   7.577271    -6.03   0.000    -60.57219   -30.82625
      ---------------------------------------------------------------------------------

      Comment


      • #4
        Guest:
        1) dicothomizing a continuous predictor, such age, is, in general, not the way to go (see https://pubmed.ncbi.nlm.nih.gov/16217841/). It is probably more informative to search for non-linear relationship between -age- and the regressand;
        2) never heard about anything similat as far as you point #1, post #1 is concerned. Stata can handle both balanced and unbalanced panels;
        3) your regression model neglect the panel data structure of your data (default instead of -vce(cluster panelid)- standarr error); under -regress- (but unlike -xtreg-, the -robust- option takes only heteroskedasticity into account).
        Last edited by sladmin; 02 Jul 2022, 08:36. Reason: anonymize original poster
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thanks for the feedback!

          Regarding the first note: If dichotomizing a continuous predictor in the context of age is not suitable due to lack of linearity, can this be solved simply by introducing an age dummy? Or what would be the optimal way here? I am not really a statistician, so I am a bit confused about the general implementation of the modeling. Here, it is only important to distinguish between older and younger executives or a long and short period of service.

          To 2 and 3: Is the Hausmann test to be carried out here, for example, or can a tendency regarding the modeling already be made at the structure and the variables (just to guarantee the consideration of the panel structure)?

          Comment


          • #6
            Guest:
            1) if you want to test non-linearities between continuous predictors and the regressand, keeping the continuous predictors as they are but including their squared term too is the way to go:
            Code:
            c.age##c.age
            This is what Rich already recommended.

            Conversely, if one of your research goal is to check the difference between two levels of the same categorical variable (over vs. below a given age cut-off), a categorical variable is the way to go (despite the evidence that you lose part of its informative strenght upon dicotomizing).

            2) despite its fragilities, -hausman- is the way to go if you want to compare -fe- vs. -re- and you adopt default standard errors. That said, the Mundlak approach (https://blog.stata.com/2015/10/29/fi...ndlak-approach) and the community-contributed module -xtoverid- are probably more flexible.
            Last edited by sladmin; 02 Jul 2022, 08:36. Reason: anonymize original poster
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thanks again! I have now splitted age into high and low and put them in interaction with my financial variable, but the cut-off for the older group was "omitted because of collinearity". In this case, would I better run two separate regressions for age_low and age_high? Before testing the models, I would like to manage to get the cut-offs for tenure and age to check that the general influence of the financial variable changes or is moderated by the group (age, tenure) to which the executive belongs.
              Code:
              . recode ceo_age min/50 = 1 51/max = 0, gen(age_low)
              (1019 differences between ceo_age and age_low)
              
              . recode ceo_age min/50 = 0 51/max = 1, gen(age_high)
              (1019 differences between ceo_age and age_high)
              
              . tab age_low age_high
              
               RECODE of |   RECODE of ceo_age
                 ceo_age |       (ceo_age)
               (ceo_age) |         0          1 |     Total
              -----------+----------------------+----------
                       0 |         0        809 |       809 
                       1 |       210          0 |       210 
              -----------+----------------------+----------
                   Total |       210        809 |     1,019
              Code:
              . regress esg_score c.curetr c.curetr#age_low c.curetr#age_high intan lev pb_ratio capint roa size salary_gap board ceo
              > _duality gender ceo_tenure i.year i.siccode, vce(r)
              note: 1.age_high#c.curetr omitted because of collinearity
              
              Linear regression                               Number of obs     =        851
                                                              F(23, 827)        =      40.34
                                                              Prob > F          =     0.0000
                                                              R-squared         =     0.4384
                                                              Root MSE          =     13.398
              
              -----------------------------------------------------------------------------------
                                |               Robust
                      esg_score |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              ------------------+----------------------------------------------------------------
                         curetr |   4.371261   3.555524     1.23   0.219    -2.607652    11.35017
                                |
               age_low#c.curetr |
                             1  |  -8.772016   3.238446    -2.71   0.007    -15.12856   -2.415475
                                |
              age_high#c.curetr |
                             1  |          0  (omitted)
                                |
                          intan |  -1.705206   5.018897    -0.34   0.734    -11.55648    8.146067
                            lev |   6.247028   4.405853     1.42   0.157    -2.400942      14.895
                       pb_ratio |  -.0245294   .0786188    -0.31   0.755    -.1788453    .1297865
                         capint |    10.9656   4.537595     2.42   0.016     2.059042    19.87216
                            roa |    24.8038    9.31881     2.66   0.008       6.5125     43.0951
                           size |   6.171308   .3896329    15.84   0.000     5.406522    6.936094
                     salary_gap |   .0251233   .0051702     4.86   0.000     .0149751    .0352715
                          board |  -.2755872   1.125644    -0.24   0.807    -2.485042    1.933868
                    ceo_duality |   3.043209   .9938728     3.06   0.002     1.092399    4.994019
                         gender |   5.177933    1.81803     2.85   0.005     1.609437    8.746429
                     ceo_tenure |  -.3893942   .0771052    -5.05   0.000    -.5407391   -.2380492
                                |
                           year |
                          2016  |   .6911621   1.603866     0.43   0.667    -2.456966     3.83929
                          2017  |   1.324798    1.60296     0.83   0.409    -1.821551    4.471147
                          2018  |   3.527925   1.531031     2.30   0.021     .5227619    6.533089
                          2019  |   4.524673   1.533702     2.95   0.003     1.514266    7.535079
                                |
                        siccode |
                             3  |   5.422113   2.910965     1.86   0.063    -.2916361    11.13586
                             4  |   6.625767    2.34169     2.83   0.005     2.029411    11.22212
                             5  |   .3659336   2.602472     0.14   0.888    -4.742294    5.474161
                             6  |   .1884965   3.168794     0.06   0.953    -6.031329    6.408322
                             7  |   2.610705    2.43528     1.07   0.284    -2.169353    7.390762
                             8  |  -.3438315   2.934011    -0.12   0.907    -6.102815    5.415152
                                |
                          _cons |   -45.3922   7.452458    -6.09   0.000    -60.02015   -30.76424
              -----------------------------------------------------------------------------------

              Comment


              • #8
                I have now put the cut-off problematic aside and have taken care of the choice of the statistical model (see output below).

                Based on "F test that all u_i=0: F(214, 622) = 28.65" and the Hausman test, can I assume that fixed effects is the right way to go here?

                Thankful for every tip!

                Code:
                . xtsum esg_score curetr cashetr intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_age ceo_te
                > nure
                
                Variable         |      Mean   Std. Dev.       Min        Max |    Observations
                -----------------+--------------------------------------------+----------------
                esg_sc~e overall |  65.15941   18.01747   3.248013    94.3814 |     N =    1019
                         between |              18.1255   3.670674   92.48193 |     n =     239
                         within  |             5.485627   39.56945   86.57859 | T-bar =  4.2636
                                 |                                            |
                curetr   overall |  .2963985   .1728918          0          1 |     N =    1077
                         between |             .1415087          0          1 |     n =     240
                         within  |             .1226713  -.1730071   .9636023 | T-bar =  4.4875
                                 |                                            |
                cashetr  overall |  .2807939   .1729476          0          1 |     N =    1018
                         between |             .1306202          0          1 |     n =     225
                         within  |             .1249657  -.1961174   .9162274 | T-bar = 4.52444
                                 |                                            |
                intan    overall |  .1103214   .1042906   .0007376   .4731707 |     N =    1110
                         between |             .0985551   .0007376   .4731707 |     n =     242
                         within  |             .0327775  -.1586331    .335545 | T-bar = 4.58678
                                 |                                            |
                lev      overall |  .1983574     .13546          0   .6064429 |     N =    1131
                         between |             .1275905          0   .6064429 |     n =     246
                         within  |             .0498542  -.1367616   .4665546 | T-bar = 4.59756
                                 |                                            |
                pb_ratio overall |  4.271298   7.399685  -3.739541   67.53844 |     N =    1097
                         between |             6.859325  -3.495186   67.53844 |     n =     241
                         within  |             4.311309  -24.23989   57.01255 | T-bar = 4.55187
                                 |                                            |
                capint   overall |  .2092085   .1795902   .0023625   .7968591 |     N =    1129
                         between |             .1758292   .0023625   .7968591 |     n =     246
                         within  |             .0366074   .0397671   .4665544 | T-bar = 4.58943
                                 |                                            |
                roa      overall |  .0851688    .071921   .0047447   .4876886 |     N =    1131
                         between |             .0653814   .0058114   .4876886 |     n =     246
                         within  |             .0269234  -.2643944   .3038462 | T-bar = 4.59756
                                 |                                            |
                size     overall |   15.9062    1.57227   12.02056   19.38892 |     N =    1133
                         between |             1.601289   12.02056   19.38892 |     n =     246
                         within  |             .2227371   14.01916   16.99831 | T-bar = 4.60569
                                 |                                            |
                salary~p overall |   79.5444   84.39617   2.153831   485.0087 |     N =     900
                         between |             77.80715   2.153831   485.0087 |     n =     225
                         within  |             40.81674  -167.0961   362.4479 | T-bar =       4
                                 |                                            |
                board    overall |  .6525173   .4764058          0          1 |     N =    1013
                         between |             .4658496          0          1 |     n =     238
                         within  |             .1066776  -.1474827   1.452517 | T-bar =  4.2563
                                 |                                            |
                ceo_du~y overall |  .3120707    .463566          0          1 |     N =    1019
                         between |             .4478125          0          1 |     n =     239
                         within  |             .1194837  -.4879293   .9787373 | T-bar =  4.2636
                                 |                                            |
                gender   overall |  .0431796    .203361          0          1 |     N =    1019
                         between |             .2019322          0          1 |     n =     239
                         within  |             .0838068  -.7568204   .8431796 | T-bar =  4.2636
                                 |                                            |
                ceo_age  overall |  55.80373   6.396581         32         75 |     N =    1019
                         between |             5.693958         34         74 |     n =     239
                         within  |             3.258413   31.40373   77.55373 | T-bar =  4.2636
                                 |                                            |
                ceo_te~e overall |  8.157998   7.015949          1         33 |     N =    1019
                         between |             6.805384        1.5         32 |     n =     239
                         within  |             2.798654    -13.042     27.658 | T-bar =  4.2636
                Code:
                . xtreg esg_score curetr intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_age ceo_tenure year
                >  siccode, fe
                note: siccode omitted because of collinearity
                
                Fixed-effects (within) regression               Number of obs     =        851
                Group variable: id                              Number of groups  =        215
                
                R-sq:                                           Obs per group:
                     within  = 0.3337                                         min =          1
                     between = 0.2056                                         avg =        4.0
                     overall = 0.1799                                         max =          5
                
                                                                F(14,622)         =      22.25
                corr(u_i, Xb)  = 0.0981                         Prob > F          =     0.0000
                
                ------------------------------------------------------------------------------
                   esg_score |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                      curetr |  -.8038043   1.620425    -0.50   0.620     -3.98597    2.378362
                       intan |  -13.18428   5.928834    -2.22   0.027    -24.82724   -1.541324
                         lev |  -7.614028    4.25824    -1.79   0.074     -15.9763    .7482415
                    pb_ratio |   .0092747   .0376491     0.25   0.805    -.0646601    .0832094
                      capint |    6.97544   5.739116     1.22   0.225    -4.294951    18.24583
                         roa |   8.096053   8.917683     0.91   0.364    -9.416362    25.60847
                        size |   3.145254    1.26049     2.50   0.013     .6699218    5.620586
                  salary_gap |  -.0131164   .0041617    -3.15   0.002     -.021289   -.0049437
                       board |   -1.85292   1.598393    -1.16   0.247    -4.991819     1.28598
                 ceo_duality |  -4.260839    1.42028    -3.00   0.003    -7.049965   -1.471714
                      gender |   2.067474   2.026263     1.02   0.308     -1.91167    6.046618
                     ceo_age |  -.0110186   .0709685    -0.16   0.877    -.1503856    .1283483
                  ceo_tenure |    .045644    .082457     0.55   0.580    -.1162839    .2075718
                        year |   1.861248   .1599455    11.64   0.000     1.547149    2.175346
                     siccode |          0  (omitted)
                       _cons |  -3734.327   311.8842   -11.97   0.000    -4346.801   -3121.854
                -------------+----------------------------------------------------------------
                     sigma_u |  15.937382
                     sigma_e |  4.8153758
                         rho |  .91634615   (fraction of variance due to u_i)
                ------------------------------------------------------------------------------
                F test that all u_i=0: F(214, 622) = 28.65                   Prob > F = 0.0000
                
                . estimates store fe
                
                . xtreg esg_score curetr intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_age ceo_tenure year
                >  siccode, re
                
                Random-effects GLS regression                   Number of obs     =        851
                Group variable: id                              Number of groups  =        215
                
                R-sq:                                           Obs per group:
                     within  = 0.3183                                         min =          1
                     between = 0.3940                                         avg =        4.0
                     overall = 0.3529                                         max =          5
                
                                                                Wald chi2(15)     =     428.02
                corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                
                ------------------------------------------------------------------------------
                   esg_score |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                      curetr |  -.6947008   1.598843    -0.43   0.664    -3.828376    2.438974
                       intan |  -12.63015   5.095914    -2.48   0.013    -22.61795   -2.642339
                         lev |  -4.460946   3.768663    -1.18   0.237    -11.84739    2.925498
                    pb_ratio |   .0189382   .0371655     0.51   0.610    -.0539048    .0917813
                      capint |   7.052376   4.231222     1.67   0.096    -1.240667    15.34542
                         roa |   14.28829   7.854178     1.82   0.069    -1.105619    29.68219
                        size |   6.348736   .6115266    10.38   0.000     5.150165    7.547306
                  salary_gap |  -.0085802   .0040289    -2.13   0.033    -.0164767   -.0006836
                       board |  -.0631253   1.262641    -0.05   0.960    -2.537856    2.411606
                 ceo_duality |  -2.425378   1.183155    -2.05   0.040     -4.74432    -.106437
                      gender |   2.798001   1.871746     1.49   0.135    -.8705543    6.466556
                     ceo_age |   .0296082   .0669177     0.44   0.658     -.101548    .1607644
                  ceo_tenure |  -.0463446   .0748263    -0.62   0.536    -.1930015    .1003123
                        year |   1.578911    .138727    11.38   0.000     1.307011    1.850811
                     siccode |  -1.303797   .5272231    -2.47   0.013    -2.337135   -.2704587
                       _cons |  -3215.284   277.2417   -11.60   0.000    -3758.667     -2671.9
                -------------+----------------------------------------------------------------
                     sigma_u |  12.927536
                     sigma_e |  4.8153758
                         rho |  .87815689   (fraction of variance due to u_i)
                ------------------------------------------------------------------------------
                
                . estimates store re
                
                . hausman fe re
                
                                 ---- Coefficients ----
                             |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                             |       fe           re         Difference          S.E.
                -------------+----------------------------------------------------------------
                      curetr |   -.8038043    -.6947008       -.1091035        .2635839
                       intan |   -13.18428    -12.63015       -.5541346        3.030303
                         lev |   -7.614028    -4.460946       -3.153082         1.98237
                    pb_ratio |    .0092747     .0189382       -.0096636         .006015
                      capint |     6.97544     7.052376       -.0769362        3.877397
                         roa |    8.096053     14.28829       -6.192234        4.223383
                        size |    3.145254     6.348736       -3.203482        1.102212
                  salary_gap |   -.0131164    -.0085802       -.0045362        .0010428
                       board |    -1.85292    -.0631253       -1.789794        .9801003
                 ceo_duality |   -4.260839    -2.425378       -1.835461        .7857102
                      gender |    2.067474     2.798001       -.7305268        .7760839
                     ceo_age |   -.0110186     .0296082       -.0406268        .0236339
                  ceo_tenure |     .045644    -.0463446        .0919885        .0346436
                        year |    1.861248     1.578911        .2823366        .0796076
                ------------------------------------------------------------------------------
                                           b = consistent under Ho and Ha; obtained from xtreg
                            B = inconsistent under Ha, efficient under Ho; obtained from xtreg
                
                    Test:  Ho:  difference in coefficients not systematic
                
                                 chi2(14) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                          =       59.35
                                Prob>chi2 =      0.0000
                                (V_b-V_B is not positive definite)
                Last edited by sladmin; 02 Jul 2022, 08:37. Reason: anonymize original poster

                Comment


                • #9
                  Kaspar:
                  te way you plugged -year- in should have been:
                  Code:
                  i.year
                  What above holds for all the >2-level categorical predictor.

                  That said, as
                  (V_b-V_B is not positive definite)
                  possibly because of singletons, I would give the community-contributed module -xtoverid- a shot, being aware of:
                  1) you shoud run the -xtreg.re- regression only and then invoke xtoverid- (its null is: -re- is the way to go);
                  2) being a bit old-fashioned, -xtoverid- does not support -fvvarlist- notation.
                  The usual work-around is to prefix your -xtreg,re- code with -xi:- (see related helpfile).

                  As an aside, with 215 panels, -vce(cluster panelid)- standard errors are almost mandatory (and, unlike -hausman-, -xtoverid- allows them).
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Thanks for the help and as feedback! I have run a pooled ols below with a split/cut-off for the age. Can this be interpreted so that if in a previously run baseline model the financial variable has a positive effect on y as a regressand, this effect reverses in the case of a person under 50 and remains positive for a person over 50?

                    Code:
                    . regress esg_score c.curetr#age_split intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_tenu
                    > re i.year i.siccode, vce(cluster id)
                    
                    Linear regression                               Number of obs     =        856
                                                                    F(23, 215)        =      16.71
                                                                    Prob > F          =     0.0000
                                                                    R-squared         =     0.4364
                                                                    Root MSE          =     13.386
                    
                                                             (Std. Err. adjusted for 216 clusters in id)
                    ------------------------------------------------------------------------------------
                                       |               Robust
                             esg_score |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                    -------------------+----------------------------------------------------------------
                    age_split#c.curetr |
                                  <51  |  -4.455077   6.006009    -0.74   0.459    -16.29328    7.383121
                                  >50  |   4.401703   4.950248     0.89   0.375    -5.355528    14.15893
                                       |
                                 intan |  -1.608273   8.633886    -0.19   0.852    -18.62617    15.40963
                                   lev |   7.054297   7.406431     0.95   0.342    -7.544217    21.65281
                              pb_ratio |  -.0182793   .1000134    -0.18   0.855    -.2154115     .178853
                                capint |   11.03918   8.593623     1.28   0.200    -5.899354    27.97772
                                   roa |   24.37592   15.91685     1.53   0.127     -6.99714    55.74898
                                  size |     6.0983   .6999447     8.71   0.000     4.718667    7.477932
                            salary_gap |   .0251173   .0080556     3.12   0.002     .0092392    .0409953
                                 board |  -.4904315   2.056146    -0.24   0.812    -4.543217    3.562353
                           ceo_duality |   3.039087    1.72797     1.76   0.080    -.3668436    6.445018
                                gender |   5.154833   3.241542     1.59   0.113    -1.234438     11.5441
                            ceo_tenure |  -.3837145   .1316186    -2.92   0.004    -.6431425   -.1242865
                                       |
                                  year |
                                 2016  |   .7183898   .8026196     0.90   0.372    -.8636208      2.3004
                                 2017  |   1.370076   1.013297     1.35   0.178    -.6271935    3.367345
                                 2018  |   3.546741   1.049974     3.38   0.001      1.47718    5.616302
                                 2019  |   4.519355   1.138251     3.97   0.000     2.275795    6.762916
                                       |
                               siccode |
                                    3  |   5.510268   5.060263     1.09   0.277     -4.46381    15.48435
                                    4  |   6.702689   4.354213     1.54   0.125    -1.879721     15.2851
                                    5  |   .2033887   4.914786     0.04   0.967    -9.483946    9.890723
                                    6  |    .115709   6.154554     0.02   0.985    -12.01528     12.2467
                                    7  |   2.600354   4.415066     0.59   0.556    -6.102001    11.30271
                                    8  |  -.5217566   5.449333    -0.10   0.924    -11.26271     10.2192
                                       |
                                 _cons |  -44.23435     13.549    -3.26   0.001    -70.94023   -17.52846
                    ------------------------------------------------------------------------------------

                    Comment


                    • #11
                      Guest:
                      not quite.
                      You should code your interaction as follows:
                      Code:
                       c.curetr##age_split
                      Last edited by sladmin; 02 Jul 2022, 08:37. Reason: anonymize original poster
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Thanks Carlo! I have applied this, but then I only get the data for one split (the older age group) in the regression output, but I would like to be able to see both moderation effects in order to compare them, even if the interpretation is difficult? or is it not possible to implement such a control of the moderation for both age groups or age in general as factor?

                        Generally speaking, I am not sure if pooled ols, re or fe is the right way? My panel data are not very equally balanced, i.e. per id some observations are missing. Can fixed effects estimator be correct here at all?

                        Code:
                        . reg esg_score c.cashetr##age_split intan lev pb_ratio capint roa size salary_gap board ceo_duality gender ceo_tenure
                        >  i.year i.siccode, vce(r)
                        
                        Linear regression                               Number of obs     =        809
                                                                        F(24, 784)        =      39.28
                                                                        Prob > F          =     0.0000
                                                                        R-squared         =     0.4488
                                                                        Root MSE          =     13.251
                        
                        -------------------------------------------------------------------------------------
                                            |               Robust
                                  esg_score |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                        --------------------+----------------------------------------------------------------
                                    cashetr |   .0234409   5.638519     0.00   0.997    -11.04494    11.09182
                                            |
                                  age_split |
                                       >55  |  -1.074025   2.319986    -0.46   0.644    -5.628145    3.480096
                                            |
                        age_split#c.cashetr |
                                       >55  |   8.441995   6.729818     1.25   0.210    -4.768601    21.65259
                        Last edited by sladmin; 02 Jul 2022, 08:37. Reason: anonymize original poster

                        Comment


                        • #13
                          Guest:
                          it makes sense, as you have a two-level categorical variable (age cut-off):
                          Code:
                          . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
                          (1978 automobile data)
                          
                          . regress price i.foreign##i.rep78, allbase
                          note: 1.foreign#1b.rep78 identifies no observations in the sample.
                          note: 1.foreign#2.rep78 identifies no observations in the sample.
                          note: 1.foreign#5.rep78 omitted because of collinearity.
                          
                                Source |       SS           df       MS      Number of obs   =        69
                          -------------+----------------------------------   F(7, 61)        =      0.39
                                 Model |    24684607         7  3526372.43   Prob > F        =    0.9049
                              Residual |   552112352        61  9051022.16   R-squared       =    0.0428
                          -------------+----------------------------------   Adj R-squared   =   -0.0670
                                 Total |   576796959        68  8482308.22   Root MSE        =    3008.5
                          
                          -------------------------------------------------------------------------------
                                  price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                          --------------+----------------------------------------------------------------
                                foreign |
                              Domestic  |          0  (base)
                               Foreign  |   2088.167   2351.846     0.89   0.378     -2614.64    6790.974
                                        |
                                  rep78 |
                                     1  |          0  (base)
                                     2  |   1403.125   2378.422     0.59   0.557    -3352.823    6159.073
                                     3  |   2042.574   2204.707     0.93   0.358    -2366.011    6451.159
                                     4  |   1317.056   2351.846     0.56   0.578    -3385.751    6019.863
                                     5  |       -360   3008.492    -0.12   0.905    -6375.851    5655.851
                                        |
                          foreign#rep78 |
                            Domestic#1  |          0  (base)
                            Domestic#2  |          0  (base)
                            Domestic#3  |          0  (base)
                            Domestic#4  |          0  (base)
                            Domestic#5  |          0  (base)
                             Foreign#1  |          0  (empty)
                             Foreign#2  |          0  (empty)
                             Foreign#3  |  -3866.574   2980.505    -1.30   0.199    -9826.462    2093.314
                             Foreign#4  |  -1708.278   2746.365    -0.62   0.536    -7199.973    3783.418
                             Foreign#5  |          0  (omitted)
                                        |
                                  _cons |     4564.5   2127.325     2.15   0.036      310.651    8818.349
                          -------------------------------------------------------------------------------
                          
                          .
                          The -allbaselevels- option, described in -help estimation options- can be useful.
                          That said, if there's evidence of a panel-wise effect, pooled OLS in not your first choice; I would start from -xtreg,fe-.
                          Last edited by sladmin; 02 Jul 2022, 08:37. Reason: anonymize original poster
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #14
                            Thanks Carlo for the quick answer! I will try the fe model again but the r-squared there was very low.

                            How are the base levels to be interpreted? If I am given a value for one group and the other represents the base?

                            Comment


                            • #15
                              Guest:
                              1) for -xtreg,fe- the within R_sq is the one to look at;
                              2) correct. Provided that you do not code things different via -fvvarlist- option, the level 0 (or recoded so by Stata) is the reference category.
                              Last edited by sladmin; 02 Jul 2022, 08:38. Reason: anonymize original poster
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X