Announcement

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

  • model with fixed effect

    Hello,

    I have a beginner question. I am trying to run a model with fixed effect. Trying some tests, I found that fe model with vce(robust) option would be good.

    Code:
    xtreg y x1 x2, fe vce(robust)

    And I also want to check a treatment effect. So, I changed it to LSDV (dummy variable) using vce(robust) option.

    Code:
    areg y I.treatment|x1 I.treatment|x2, absorb(id) vce(robust)
    My concern is that the robust standard errors are not the same. I would appreciate if you let me know how to make it.
    Thank you.





  • #2
    -robust- in areg calculates White standard errors which are not appropriate for panel data. You need

    Code:
    areg y I.treatment|x1 I.treatment|x2, absorb(id) cluster(id)
    to match the -robust- option in xtreg. This assumes your xtset command was

    Code:
    xtset id year
    Last edited by Andrew Musau; 18 Dec 2022, 15:56.

    Comment


    • #3
      Thank you for quick answer Andrew.

      Yes, xtset is like that. And the robust standard errors are not exactly the same but become very close.

      I compared the two like:

      Code:
       
       xtreg y x1 x2, fe vce(robust)
      and

      Code:
       
       areg y x1 x2, absorb(id) cluster(id)

      Comment


      • #4
        There is a degrees of freedom adjustment that areg applies as it absorbs the indicators. You can get the same standard errors by asking xtreg to do the same using the option -dfadj-.

        Code:
        xtreg y x1 x2, fe vce(robust) dfadj

        Comment


        • #5
          Thanks a lot. I will try it.

          Comment

          Working...
          X