Announcement

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

  • Reghdfe lead and lag variables

    I am running a regression with firm-year panel data and am wondering why I get different results using two methods:

    1. Create a lead variable then run the regression:
    bys firm (year): leadY= F1.Y
    reghdfe leadY x1 x2, noa vce(robust)

    2. Directly run the regression with the forward operator:

    reghdfe F.Y x1 x2, noa vce(robust)

    In both cases, I xtset the data with command xtset firm year

    Thanks in advance.

  • #2
    reghdfe is from SSC, as you are asked to explain (FAQ Advice #12). Here are some comments:

    1. If time-series operators are allowed (and in this case they are), you should always prefer them over manually generating variables. There is potential for error using the manual approach.

    Code:
    xtset firm year
    reghdfe F.Y x1 x2 ...
    2. Including the option -noabsorb- implies that you are not taking into account the panel structure of your data. Your estimator is pooled OLS which is biased unless you can otherwise show that it is not.

    3. xtsetting the data already declares to Stata that you have panel data. Therefore, generating the lead variable by firm is not necessary. Also, beware of issues arising from precision when generating variables. The default storage type for Stata is float. Either

    Code:
    xtset firm year
    gen double leadY= F.Y
    or with a balanced panel

    Code:
    bys firm (Year): gen double leadY= Y[_n+1]
    Last edited by Andrew Musau; 28 Jun 2023, 19:04.

    Comment

    Working...
    X