Announcement

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

  • Panel data regression with fixed effects

    Hi Statalist,

    Recently I am using the state-level mental health data and trying to find its association with state-level literacy. However, I have difficulty understanding the regression results when I use different commands and therefore list them below:
    1. Panel regression with fixed effects (I first run a baseline regression and only include y and x: xtreg mental literacy, fe)
    In this regression, we can see that the coefficient of x is significantly negative
    Click image for larger version

Name:	pic1.png
Views:	1
Size:	32.6 KB
ID:	1661687

    2.Panel regression with year fixed effects ( I use: xtreg y x i.year, fe, which gives me the same results when I use xtreg y x i.year i.state)
    In this regression, we can see that the coefficient of x is no longer significant, my understanding is that the time fixed effect can be the explanation and 'absorb' the significance of x
    Click image for larger version

Name:	pic2.png
Views:	1
Size:	55.0 KB
ID:	1661688



    Click image for larger version

Name:	pic3.png
Views:	1
Size:	86.6 KB
ID:	1661689


    3.I also use a 'reg y x i.state i.year, r' and obtain the same results
    Click image for larger version

Name:	pic4.png
Views:	1
Size:	94.6 KB
ID:	1661690

    '
    Above all, I want to ask what is the difference between 'xtreg y x, fe' and 'xtreg y x i.year, fe'. Does the first one controls only the state fixed effect and the second controls both state and time fixed effect? It is hard for me to understand why the first regression shows significant coefficient of x, but the coefficients are insignificant for regression 2 and 3. To be more specific, How should I interpret the first regression (xtreg y x, fe)? Look forward to your reply!

    Best regards,
    Suyi Liu

  • #2
    Suyi:
    I would go:
    Code:
    xtreg y x i.year, fe vce(cluster state)
    Your intuition about the difference between code #1 and #2 is correct.
    -regress- with -i.state- and -i.year- is simply another way to go -xtreg,fe-: therefore, the results are identical.
    However, -regress- does not give back the additioadditional statistics related to panel-wise effect (sigmas and rho).
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear Carlo Lazzaro ,

      If the code is with time dummies and without country/state dummies, what would be the difference?

      Code:
      reress y x i.year, vce(cluster state)
      Best,



      Comment


      • #4
        Nihat:
        if you omit -i.state- from the right-hand side of your regression equation you do not get the -state- fixed effect that you would obtain via -xtreg postestimation- after:
        Code:
        xtset idcode year
        xtreg y x i.year, fe vce(cluster idcode)
        Conversely, the code mentioned above and the following one:
        Code:
        regress y x i.state i.year, vce(cluster idcode)
        give you back identical sample estimates of the shared coefficients.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment

        Working...
        X