Announcement

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

  • Reghdfe Definition of Singleton

    I am running a regression that requires a fixed effect variable, which we’ll call fe. When I manually remove the singleton observations, I am left with 22,000 observations.

    Here is my code for filtering singletons:
    gen fe_filter = 0
    by fe, sort: egen tot = count(fe)
    replace fe_filter = 1 if tot > 1
    keep if fe_filter == 1


    I then use areg:

    areg y x1, absorb(fe)

    and get an r squared of .88.


    I then run reghdfe, again after manually dropping the singletons, again leaving n=22000. However it automatically drops another 12000 observations, leaving 10,000 observations and an r squared of .75.

    Here is my code for reghfe
    reghdfe y x1, absorb(fe)

    Any idea why regdhfe might be dropping the extra 12000 observations?

  • #2
    You should check for groups with single observations for combinations of y and x1 (possibly due to missing values). The singleton condition does not depend only on your panel identifier.

    Comment


    • #3
      Thank you Andrew! I will check for duplicate combinations of x and y.

      Comment

      Working...
      X