Announcement

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

  • Two-way fixed effect model

    I am using Stata 13.0.


    I would like to run a two-way fixed effect model using a strong balanced panel data set constructed from 111 firms with 6 years time period.

    It seems like -xtreg- could help me to apply fixed effect for each firm, but how about the "year"? Should I just add the dummy variable of -i.year- (or just -year-?) in the model of xtreg y x1 x2 x3, fe?

    Or is there other way to run the two-way fixed effect model?

    Thank you.

  • #2
    Bay:
    you can try
    Code:
    xtreg y x1 x2 x3 i.year, fe
    See also and old thread on Statalist about this topic at http://www.stata.com/statalist/archi.../msg00447.html

    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Two-way fixed effects estimates can be obtained by running OLS with cross-sectional and time dummies. Eviews has an option to run two-way fixed effects using the drop-down menu. Unfortunately, there is no stata command that directly does two-way fixed effects. The command xtreg y x1 x2 ... xn, fe provides cross-sectional fixed effects estimates. Therefore, you may explicitly add time dummies into the cross-section fixed effects equation as Carlo suggests, i.e.,

      xtreg y x1 x2 ... xn i.year, fe

      or just run OLS with cross-sectional and time dummies i.e.,

      reg y x1 x2 ... xn i.firm i.year.

      It is important to check whether two way fixed effects is appropriate relative to OLS by checking the significance of both cross-sectional and year dummies, relative to one-way fixed effects by checking the significance of the time dummies, and relative to a two-way random effects model or a mixed model (random cross-section, fixed period or fixed cross-section, random period) by performing a series of Hausman tests. The textbook by Baltagi (Econometric Analysis of Panel Data) is an excellent reference.



      Comment


      • #4
        Thank you very much for the precious advices.

        The result of my one way fixed model (xtreg y l.x1, fe) is not significant.

        While for the two way model:-

        xtreg y x1 i.year, fe

        The result is not significant for the l.x1 (with 1 year time lag), but is significant for all the time dummies.
        Nevertheless, the result is significant for 'x1' (without the time lag effect), but not all the time dummies.

        In such case, which model is more appropriate in between one way and two way fixed effect model?

        Thank you.

        Comment


        • #5
          Bay:
          your chance of getting helpful replies would increase if you post not only what you typed but also what Stata gave you back.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Hi Bay again

            You should formally test for the joint significance of the cross-section and time dummies by performing a Chow test (as opposed to manually inspecting the significance of these dummies). You do this by computing an F-statistic using the following formula where your null hypothesis is that all dummies are jointly equal to 0.

            F = [(RRSS - URSS) / (N +T - 2)] / [URSS/ (N -1) (T - 1) - K]

            where RRSS is the residual sum of squares obtained from pooled OLS, URSS is the residual sum of squares obtained from the FE regression, N is the number of firms, T is the number of years, and K the number of independent variables in your model. Under the null, F is distributed as F(N+T-2), (N -1)(T - 1)-K

            Therefore, first run pooled OLS using the command reg y x1 x2 ... xn and obtain the RRSS. Next run the two-way FE regression using the command reg y x1 x2 ... xn i.firm i.year and obtain the URSS. Compute the F-statistic and check if it is significant. This gives you the choice between pooled OLS and FE.

            If you reject poolability, you can test for cross-section (firm) effects allowing for time effects where your null hypothesis is that the firm dummies are jointly equal to zero whereas the time dummies are not. You use the same formula as above except that your RRSS is the residual sum of squares with time dummies only, i.e., from the regression

            reg y x1 x2 ... xn i.year

            The URSS is still the residual sum of squares obtained from the FE regression.

            You may also test for time effects allowing for firm effects using an analogous procedure. The latter gives you the choice between one-way FE and the two-way FE model.


            Comment


            • #7
              Thank you very much.

              I will try to work on this method and see the result. =)

              Comment


              • #8
                I honestly wouldn't bother with testing whether the FEs are significant. Worst case scenario you are adding some noise by including irrelevant regressors. Besides, there should be an ex ante reason why you think including time+firm fixed effects is important (like suspecting firm heterogeneity).

                In any case, both areg and reghdfe (ssc) test for the significance of the FEs so instead of coding it and risking errors, I would just use any of those.

                Comment

                Working...
                X