I would like to run a diff-in-diff model with state fixed effects (FE), year FE and states specific trends with reghdfe.
the model I would like to estimate is the following: where y is my dependent variable and treat is a dummy indicating whether the state was treated.
Code:
y_{i,t}=\beta treat_{i,t}+\sum \gamma_k state_{k,s}+\sum \delta_j year_{j,y}+\sum\theta_k(state\times t)+\varepsilon
Code:
cap egen stateFE=group(states) // create my state fe cap egen yearFE=group(year)// create my year fe reghdfe y treat, a(i.stateFE##c.year) cluster(prod) //or reghdfe y treat, a(yearFE i.stateFE##c.year) cluster(prod)
Thanks a lot for your help
Best regards
0 Response to reghdfe: running a difference in difference model with state FE, year FE and country specific trends
Post a Comment