The panel data has two dimensions: TYPE2(firms) and yr(year)
pt is a binary variable (receiving value 0 or 1)
Set of code1 (reg command):
Code:
** Begin Manual 2SDiD * Step 1: Manually (note standard errors are off) reg l_homicide i.sid i.year [aweight=popwt] if post == 0 * Step 2: Regress transformed outcome onto treatment status for all units predict adj, residuals reg adj i.post [aweight=popwt], vce(cluster sid) nocons
Set of code 2:
Code:
reghdfe l_homicide [aweight=popwt] if post == 0, a(sid year) res(adj1) reghdfe adj1 post [aweight=popwt] ,noabsorb nocons vce(cluster sid)
What are the difference between these two set of codes when running on a panel dataset?
Thanks and warm regards.
0 Response to Comparing the code of reg and reghdfe in a panel data ?
Post a Comment