Hi all
To better understand what is going on in the 'didregress'-command, I want to be able to write it up as a reg-command. I have tried two procedures of doing this. The coefficients obtained are the same as in 'didregress' but the standard errors differ:
In a previous post Enrique Pinzon (StataCorp) explained that the standard errors in procedure 2 differed because it was a 2-by-2 DiD which differed from the generalized/two-way fixed effect DiD used in 'didregress'. The 'reg' in procedure 1 is my best attempt of writing a generalized DiD, but the standard errors differ from those obtained by 'didregress'. Maybe this is because the standard errors of month is also calculated? Could someone kindly explain how to write the 'didregress' using 'reg'?
To better understand what is going on in the 'didregress'-command, I want to be able to write it up as a reg-command. I have tried two procedures of doing this. The coefficients obtained are the same as in 'didregress' but the standard errors differ:
Code:
use https://www.stata-press.com/data/r17/hospdd, clear didregress (satis) (procedure), group(hospital) time(month) *procedure 1 recode hospital (1/18=1 "Treated") (19/46=0 "Control"), gen(treated) reg satis treated##procedure i.month, vce(cluster hospital) *procedure 2 recode month (1/3 = 0 "Pre") (4/7 = 1 "Post"), gen(period) reg satis i.period##i.treated, vce(cluster hospital)
Comment