Announcement

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

  • Problems with adding both year and industry fixed effects into 1 regression model

    Hi all,

    I have a panel data set and I want to run a regression with year and industry fixed effects.
    I used the variables year and sic2 to do this, as year represents the years from 2016-2020 and sic2 represents the two-digit sic codes.
    However, when I run the following code I get a result where the values for industry are all omitted:

    xtreg ROA ESG_score firmsize CASH_ RandD net_ppe leverage BoardSize i.year i.sic2, vce(robust) fe

    Fixed-effects (within) regression Number of obs = 1,220
    Group variable: id Number of groups = 244

    R-squared: Obs per group:
    Within = 0.0238 min = 5
    Between = 0.2353 avg = 5.0
    Overall = 0.1612 max = 5

    F(11,243) = 1.29
    corr(u_i, Xb) = 0.2337 Prob > F = 0.2323

    (Std. err. adjusted for 244 clusters in id)
    ------------------------------------------------------------------------------
    | Robust
    ROA | Coefficient std. err. t P>|t| [95% conf. interval]
    -------------+----------------------------------------------------------------
    ESG_score | .2066711 .109629 1.89 0.061 -.0092734 .4226156
    firmsize | -.6507959 1.427282 -0.46 0.649 -3.462219 2.160627
    CASH_ | .0489396 .084858 0.58 0.565 -.1182116 .2160908
    RandD | -.0312299 .049384 -0.63 0.528 -.1285052 .0660454
    net_ppe | .0368516 .0366825 1.00 0.316 -.0354048 .1091079
    leverage | .0070421 .0235763 0.30 0.765 -.0393979 .0534822
    BoardSize | -.3978802 .7138968 -0.56 0.578 -1.804096 1.008335
    |
    year |
    2017 | -1.570544 1.486551 -1.06 0.292 -4.498714 1.357626
    2018 | -.0440781 1.801801 -0.02 0.981 -3.593219 3.505063
    2019 | -.4039425 1.713684 -0.24 0.814 -3.779513 2.971628
    2020 | -3.996366 2.301874 -1.74 0.084 -8.530538 .5378054
    |
    sic2 |
    13 | 0 (omitted)
    20 | 0 (omitted)
    24 | 0 (omitted)
    25 | 0 (omitted)
    26 | 0 (omitted)
    28 | 0 (omitted)
    29 | 0 (omitted)
    30 | 0 (omitted)
    31 | 0 (omitted)
    32 | 0 (omitted)
    33 | 0 (omitted)
    34 | 0 (omitted)
    35 | 0 (omitted)
    36 | 0 (omitted)
    37 | 0 (omitted)
    38 | 0 (omitted)
    39 | 0 (omitted)
    48 | 0 (omitted)
    49 | 0 (omitted)
    51 | 0 (omitted)
    52 | 0 (omitted)
    59 | 0 (omitted)
    60 | 0 (omitted)
    67 | 0 (omitted)
    73 | 0 (omitted)
    79 | 0 (omitted)
    80 | 0 (omitted)
    82 | 0 (omitted)
    87 | 0 (omitted)
    |
    _cons | 4.842982 12.97236 0.37 0.709 -20.70964 30.3956
    -------------+----------------------------------------------------------------
    sigma_u | 19.224221
    sigma_e | 16.38106
    rho | .57934629 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------

    How do I get both year and industry fixed effects in 1 regression model?
    Also, one of the articles that I follow (Velte,2019) added both year and industry fixed effects in a model by creating dummies:

    Click image for larger version

Name:	Screenshot 2022-05-29 at 15.52.57.png
Views:	1
Size:	31.0 KB
ID:	1666788

    I thought that the 'i.' in i.year and i.sic2 automatically created a dummy of the year and industries variable or do I need to create dummies of year and industries in another way before I can add them both to the regression model?

    Also, does the YES in the table behind industry dummies and year dummies mean that (Velte, 2019) did add year and industry fixed effects in its models instead of show what values the industry and year fixed effects dummies actually have when running the regression?

    Can someone please help me with my questions?
    I'm using Stata 17 on a MacOs. Catalina.
    Below you can find a sample of my dataset;

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str45 name int year float(sic2 ROA) double ESG_score float firmsize
    "ANI PHARMACEUTICALS - ESG Combined Score"     2016 28   12.184697 19.25  5.777231
    "ANI PHARMACEUTICALS - ESG Combined Score"     2017 28   -2.610776 21.63  6.021358
    "ANI PHARMACEUTICALS - ESG Combined Score"     2018 28  .035982016 18.12  6.065189
    "ANI PHARMACEUTICALS - ESG Combined Score"     2019 28   13.340952 19.99  6.124222
    "ANI PHARMACEUTICALS - ESG Combined Score"     2020 28  -.04889091 21.78   6.13381
    "ABBVIE - ESG Combined Score"                  2016 28    90.06187 74.88 4.1911535
    "ABBVIE - ESG Combined Score"                  2017 28    75.00071 70.79  4.259661
    "ABBVIE - ESG Combined Score"                  2018 28    95.81817 50.58 4.0834856
    "ABBVIE - ESG Combined Score"                  2019 28    88.44751  56.9  4.489928
    "ABBVIE - ESG Combined Score"                  2020 28   30.657856 48.59  5.014395
    "ACORDA THERAPEUTICS - ESG Combined Score"     2016 28  -.02578939 23.68  7.202166
    "ACORDA THERAPEUTICS - ESG Combined Score"     2017 28  -.18644807 24.94  7.088383
    "ACORDA THERAPEUTICS - ESG Combined Score"     2018 28   .02591589 27.45  7.169863
    "ACORDA THERAPEUTICS - ESG Combined Score"     2019 28   -.3413278  37.7  6.684259
    "ACORDA THERAPEUTICS - ESG Combined Score"     2020 28  -1.5741607  37.3  6.449965
    "ACTIVISION BLIZZARD - ESG Combined Score"     2016 73    55.35182 53.16  2.859454
    "ACTIVISION BLIZZARD - ESG Combined Score"     2017 73   14.623956 43.41  2.926811
    "ACTIVISION BLIZZARD - ESG Combined Score"     2018 73   101.65405 51.78  2.881163
    "ACTIVISION BLIZZARD - ESG Combined Score"     2019 73    75.73696 59.86  2.987952
    "ACTIVISION BLIZZARD - ESG Combined Score"     2020 73    95.07118 35.62  3.140222
    "ACUITY BRANDS - ESG Combined Score"           2016 36   .09864315  30.4  7.988882
    "ACUITY BRANDS - ESG Combined Score"           2017 36   .11094633 41.05  7.972328
    "ACUITY BRANDS - ESG Combined Score"           2018 36   .11697003 41.33  8.002627
    "ACUITY BRANDS - ESG Combined Score"           2019 36   .10414828 62.56  8.062243
    "ACUITY BRANDS - ESG Combined Score"           2020 36   .07111149 55.18  8.158144
    "ADTRAN - ESG Combined Score"                  2016 36   .05279849 52.79  6.503142
    "ADTRAN - ESG Combined Score"                  2017 36   .03563027 47.36  6.505925
    "ADTRAN - ESG Combined Score"                  2018 36  -.03079804 53.51  6.442583
    "ADTRAN - ESG Combined Score"                  2019 36  -.09719364 35.93  6.301003
    "ADTRAN - ESG Combined Score"                  2020 36    4.523673 50.83  6.264691
    "ADVANSIX - ESG Combined Score"                2016 28   .03773328 29.14  6.807888
    "ADVANSIX - ESG Combined Score"                2017 28   .13967688 47.45  6.956806
    "ADVANSIX - ESG Combined Score"                2018 28  .064027004 48.11  6.941795
    "ADVANSIX - ESG Combined Score"                2019 28  .033453103 51.71  7.119611
    "ADVANSIX - ESG Combined Score"                2020 28   .03647043 57.44  7.141567
    "ALSP.HLTHCR.SLTN. - ESG Combined Score"       2016 73 -.006693877 29.78 8.2511835
    "ALSP.HLTHCR.SLTN. - ESG Combined Score"       2017 73  -.04644256 31.17  8.349993
    "ALSP.HLTHCR.SLTN. - ESG Combined Score"       2018 73    .1143303 37.03  8.065103
    "ALSP.HLTHCR.SLTN. - ESG Combined Score"       2019 73  -.05682871 33.89  8.072698
    "ALSP.HLTHCR.SLTN. - ESG Combined Score"       2020 73   .24006124 33.64  7.978523
    "ANSYS - ESG Combined Score"                   2016 73   .09485218 53.66  7.937562
    "ANSYS - ESG Combined Score"                   2017 73   .08813196 43.07  7.986717
    "ANSYS - ESG Combined Score"                   2018 73   .12840772 45.86 8.0913105
    "ANSYS - ESG Combined Score"                   2019 73   .09326421  55.5   8.48444
    "ANSYS - ESG Combined Score"                   2020 73   .07303769 55.52  8.689564
    "APPLIED OPTOELECTRONICS - ESG Combined Score" 2016 36    .0969043 17.54  5.775538
    "APPLIED OPTOELECTRONICS - ESG Combined Score" 2017 36     1.63253 17.98  6.115857
    "APPLIED OPTOELECTRONICS - ESG Combined Score" 2018 36   -4.596864    17  6.145987
    "APPLIED OPTOELECTRONICS - ESG Combined Score" 2019 36  -1.4148557 17.91  6.145955
    "APPLIED OPTOELECTRONICS - ESG Combined Score" 2020 36  -.12157112  17.1  6.175462
    "AVANOS MEDICAL - ESG Combined Score"          2016 38   .01921035 52.43  7.636173
    "AVANOS MEDICAL - ESG Combined Score"          2017 38  .036112756  45.5  7.694347
    "AVANOS MEDICAL - ESG Combined Score"          2018 38  .031362496 53.75  7.513927
    "AVANOS MEDICAL - ESG Combined Score"          2019 38  -.02550567  52.2   7.49532
    "AVANOS MEDICAL - ESG Combined Score"          2020 38 -.016260162 45.97  7.422254
    "AXON ENTERPRISE - ESG Combined Score"         2016 34   .06218296 17.37  5.628207
    "AXON ENTERPRISE - ESG Combined Score"         2017 34   15.400223  25.5  5.823377
    "AXON ENTERPRISE - ESG Combined Score"         2018 34   .04058843  18.9  6.578612
    "AXON ENTERPRISE - ESG Combined Score"         2019 34 .0010429983 18.83  6.740093
    "AXON ENTERPRISE - ESG Combined Score"         2020 34    -1.24835 29.11   7.23058
    "BIOGEN - ESG Combined Score"                  2016 28    .1618583 73.86  10.03788
    "BIOGEN - ESG Combined Score"                  2017 28   .10734972 60.66 10.071228
    "BIOGEN - ESG Combined Score"                  2018 28   .17520335 80.09  10.13812
    "BIOGEN - ESG Combined Score"                  2019 28   .22679043 76.29 10.164486
    "BIOGEN - ESG Combined Score"                  2020 28   .16250117 56.06  10.11127
    "BIO-TECHNE - ESG Combined Score"              2016 28   .09249093 34.54  7.029602
    "BIO-TECHNE - ESG Combined Score"              2017 28   .04882882 45.33  7.351299
    "BIO-TECHNE - ESG Combined Score"              2018 28   .07918017 50.88  7.373501
    "BIO-TECHNE - ESG Combined Score"              2019 28   .05098253 65.97   7.54137
    "BIO-TECHNE - ESG Combined Score"              2020 28     .113088 56.83  7.614603
    "BLACKBAUD - ESG Combined Score"               2016 73  .031685762 35.09  7.177943
    "BLACKBAUD - ESG Combined Score"               2017 73   .03747415 48.66  7.472743
    "BLACKBAUD - ESG Combined Score"               2018 73  .027760083 38.84  7.387279
    "BLACKBAUD - ESG Combined Score"               2019 73  .005975023 47.89  7.597378
    "BLACKBAUD - ESG Combined Score"               2020 73    3.774085  54.4  7.623023
    "BOSTON SCIENTIFIC - ESG Combined Score"       2016 38    19.17551 71.58  2.895691
    "BOSTON SCIENTIFIC - ESG Combined Score"       2017 38    5.461611 74.39  2.946647
    "BOSTON SCIENTIFIC - ESG Combined Score"       2018 38    79.57522 72.01  3.044475
    "BOSTON SCIENTIFIC - ESG Combined Score"       2019 38    138.3006 83.82 3.4198556
    "BOSTON SCIENTIFIC - ESG Combined Score"       2020 38   -2.664327 47.49 3.4267676
    "BOTTOMLINE TECHS. - ESG Combined Score"       2016 73  -.03009403 21.99  6.481404
    "BOTTOMLINE TECHS. - ESG Combined Score"       2017 73  -.05366846 27.72  6.425581
    "BOTTOMLINE TECHS. - ESG Combined Score"       2018 73   1.4667405 29.62  6.455148
    "BOTTOMLINE TECHS. - ESG Combined Score"       2019 73    14.09383 30.15  6.506126
    "BOTTOMLINE TECHS. - ESG Combined Score"       2020 73  -1.1636072 34.49  6.675996
    "BRADY NONVOTING A - ESG Combined Score"       2016 35   .07673636  30.4   6.95078
    "BRADY NONVOTING A - ESG Combined Score"       2017 35   .09107114  40.6  6.956758
    "BRADY NONVOTING A - ESG Combined Score"       2018 35    .0861551  34.8  6.963125
    "BRADY NONVOTING A - ESG Combined Score"       2019 35   .11341666 34.85  7.053852
    "BRADY NONVOTING A - ESG Combined Score"       2020 35   .09835654 37.12  7.040945
    "CTS - ESG Combined Score"                     2016 38    .0664095 36.39   6.24939
    "CTS - ESG Combined Score"                     2017 38  .026770627 37.22  6.291006
    "CTS - ESG Combined Score"                     2018 38    .0848596 35.63  6.306897
    "CTS - ESG Combined Score"                     2019 38   .05618369 43.06  6.466695
    "CTS - ESG Combined Score"                     2020 38   .05540461  34.6  6.439429
    "CABOT - ESG Combined Score"                   2016 28    20.63712 67.72  1.976855
    "CABOT - ESG Combined Score"                   2017 28     33.3795 79.07  1.976855
    "CABOT - ESG Combined Score"                   2018 28   -15.65097 78.62  1.976855
    "CABOT - ESG Combined Score"                   2019 28    21.74515 76.82  1.976855
    "CABOT - ESG Combined Score"                   2020 28   -32.96399 73.88  1.976855
    end

    Thanks in advance!


  • #2
    Qi:
    no surprise indeed, as the -fe- estimator wipes out time-invariant variables.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      But do you know maybe a way how I can add both industry and year fixed effects in 1 model?
      Do I need to change something to my model or code? Or is it impossible to add both year and industry fixed effects into 1 model?

      Comment


      • #4
        Qi:
        the issue rests on the -fe- estimator features.
        While -i.year- changes within panel, -i.
        industry- very often does not. Therefore, due to demeaning, no coefficient will be returned.
        To estimate it, you should switch to -re- specification.
        However, if -fe- is the way to go, -re- is inconsistent and your results unreliable.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X