Announcement

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

  • Panel data with only Year Fixed Effects

    Hi,

    I am new to Stata and have a question about how to construct a panel data regression when I only want to eliminate the time fixed effects.

    I have a dataset of 10 industries over 17 years (so I have a problem of small N compared to T). I want to understand the impact of an industry on the dependent variable, and I only want to understand the effect of one industry compared to the average of all others. Can I use -xtset year- to correct for year fixed effects (not including a panel) and then a dummy for the "industry 1" to interpret. Then I will run the -xtreg, fe-. Alternatively, is it better to use LSDV with a dummy for all years + one for the sector in question? I get the same coefficient for industry 1 using both methods, but some minor variation in SE and P values. I also want to use robust standard errors.

    I hope you can help me for how to only correct for time fixed effect!

    Thank you!

  • #2
    Can I use -xtset year- to correct for year fixed effects (not including a panel) and then a dummy for the "industry 1" to interpret. Then I will run the -xtreg, fe-. Alternatively, is it better to use LSDV with a dummy for all years + one for the sector in question?
    Either method [least squares dummy variables (LSDV) or the within-estimator (xtreg, fe)] is a valid estimation method for the fixed effects model. The small differences in standard errors reflect different degrees of freedom employed in these regressions.

    I hope you can help me for how to only correct for time fixed effect!
    Your code will estimate a time-fixed effects model. But I think you should let the sample data make the call with regards to whether you include the industry fixed effects and not yourself by looking at the \(N\) and \(T\) dimensions. The test for poolability is the Wald test for the joint significance of the industry dummies.

    Code:
    regress depvar indepvars i.industry
    testparm i.industry
    If you reject the null hypothesis, you need to have the industry effects in the model.

    I also want to use robust standard errors.
    Clustering is out of the question given your sample size. The clustered standard errors can be severely biased with a small number of clusters (rule of thumb > 30 clusters). In addition, I would recommend that you run a first-differences regression to check the robustness of the FE results. With \(T>N\), inference can be very sensitive to violations of the classical assumptions. First-differencing will deal with any possible nonstationarity. The recommendation is in Wooldridge's MIT textbook if you need a reference.

    Code:
    xi: regress D.(depvar indepvars i.time), nocons
    Last edited by Andrew Musau; 22 Oct 2021, 04:14.

    Comment


    • #3
      Thank you, Andrew!!

      My initial regression is:
      - xtset year -
      - xtreg, dependent Industry1 controls, fe vce(robust) -

      All other 10 industries will then be in the dummy that is left out "not industry1". We want to interpret the coefficient of industry1.

      When running the:

      regress depvar indepvars i.industry
      testparm i.industry

      I get the value 0 for all industry dummies and a P-value of 0 so I reject the null hypothesis. However, since we are interested in the difference in the industries, and not to control for them, will the initial test still be valid?

      //

      I will look into if I can improve my N by including firm-level data in the dataset and setting this as the panel. Then include the industry1 dummy in the regression to interpret the results. However, I am afraid that removing some of the firm-specific effects also removes industry-related effects. An alternative is to only remove year-specific effects, and I would still have a larger N. (Firm-level data will however cause problems with missing data points in the controls, which is not a problem when using the average at an aggregated industry level).

      Thanks again!

      Comment


      • #4
        Yes, sorry I missed that detail when reading your post. Remove the option -vce(robust)- as the clustering issue still holds.

        Code:
        xtset year
        xtreg, dependent Industry1 controls, fe
        You can also test whether the year indicators are needed. Here is an example that uses the Grunfeld dataset and indicates that I can pool the years.


        Code:
        webuse grunfeld
        xtset year
        gen company1= 1.company
        xtreg invest mvalue kstock company1, fe
        *TEST IN FOOT OF XTREG TABLE SAME AS
        qui regress invest mvalue kstock company1 i.year
        testparm i.year
        *POOLED MODEL PREFERRED
        regress invest mvalue kstock company1
        Res.:

        Code:
         xtreg invest mvalue kstock company1, fe
        
        Fixed-effects (within) regression               Number of obs     =        200
        Group variable: year                            Number of groups  =         20
        
        R-sq:                                           Obs per group:
             within  = 0.8038                                         min =         10
             between = 0.9325                                         avg =       10.0
             overall = 0.8122                                         max =         10
        
                                                        F(3,177)          =     241.73
        corr(u_i, Xb)  = 0.0575                         Prob > F          =     0.0000
        
        ------------------------------------------------------------------------------
              invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              mvalue |   .1165248    .010141    11.49   0.000     .0965121    .1365376
              kstock |   .2196064   .0325168     6.75   0.000      .155436    .2837769
            company1 |   1.464985   42.44202     0.03   0.973    -82.29253     85.2225
               _cons |  -40.84612   11.65874    -3.50   0.001    -63.85414    -17.8381
        -------------+----------------------------------------------------------------
             sigma_u |  15.314513
             sigma_e |   98.37551
                 rho |  .02366099   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        F test that all u_i=0: F(19, 177) = 0.23                     Prob > F = 0.9997
        
        .
        . *TEST IN FOOT OF XTREG TABLE SAME AS
        
        .
        . qui regress invest mvalue kstock company1 i.year
        
        .
        . testparm i.year
        
         ( 1)  1936.year = 0
         ( 2)  1937.year = 0
         ( 3)  1938.year = 0
         ( 4)  1939.year = 0
         ( 5)  1940.year = 0
         ( 6)  1941.year = 0
         ( 7)  1942.year = 0
         ( 8)  1943.year = 0
         ( 9)  1944.year = 0
         (10)  1945.year = 0
         (11)  1946.year = 0
         (12)  1947.year = 0
         (13)  1948.year = 0
         (14)  1949.year = 0
         (15)  1950.year = 0
         (16)  1951.year = 0
         (17)  1952.year = 0
         (18)  1953.year = 0
         (19)  1954.year = 0
        
               F( 19,   177) =    0.23
                    Prob > F =    0.9997
        
        .
        . *POOLED MODEL PREFERRED
        
        .
        . regress invest mvalue kstock company1
        
              Source |       SS           df       MS      Number of obs   =       200
        -------------+----------------------------------   F(3, 196)       =    282.94
               Model |  7604100.95         3  2534700.32   Prob > F        =    0.0000
            Residual |  1755842.97       196  8958.38251   R-squared       =    0.8124
        -------------+----------------------------------   Adj R-squared   =    0.8095
               Total |  9359943.92       199  47034.8941   Root MSE        =    94.649
        
        ------------------------------------------------------------------------------
              invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              mvalue |   .1153472   .0094722    12.18   0.000     .0966666    .1340278
              kstock |   .2306646   .0255452     9.03   0.000     .1802858    .2810433
            company1 |   1.144714    39.6654     0.03   0.977    -77.08105    79.37048
               _cons |  -42.59245   10.42974    -4.08   0.000    -63.16137   -22.02354
        ------------------------------------------------------------------------------
        
        .
        Last edited by Andrew Musau; 22 Oct 2021, 06:33.

        Comment


        • #5
          Thank you so much! This was very helpful

          Comment

          Working...
          X