Announcement

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

  • Pooled OLS including Year and Firm Fixed Effects

    Hi,

    I am trying to run a pooled OLS on my unbalanced panel data including firm and time (quarter) fixed effects in the following form:

    Code:
    reg DV IV Controls  i.Quarter i.FirmID, vce (cluster FirmID)
    I receive the error: FirmID: factor variables may not contain noninteger values.
    The code works fine if I go with c.FirmID but I was wondering if this will also include firm fixed effects in my model?

    Cheers

  • #2
    Code:
    egen firm_id_numeric=group(FirmID)

    Comment


    • #3
      Why not use the user written command reghdfe?

      Code:
       
       reghdfe DV IV Controls  , vce (cluster firm_id_numeric) abs(i.Quarter i.firm_id_numeric)

      Comment


      • #4
        Originally posted by Marc Pelow View Post
        I receive the error: FirmID: factor variables may not contain noninteger values.
        Why do you have noninteger values for FirmID in the first place? This should be your starting point.

        Code:
        tab FirmID

        Comment


        • #5
          Thank you all for the helpful replies!

          Comment

          Working...
          X