I am currently replicating a paper (Penasco & Anadon (2023)) in Stata. Who use a staggered DiD model to illustrate lags and leads of treatment.
Using the 'tvdiff' command, they provide the command that executes the output. However, when attempting to replicate, I am consistently getting that my dummies are being omitted due to collinearity and I can't seem to adapt my code to account for this.
The current code is as follows:
Where 'activetreat' is a dummy with a value of 0 for all households in the control group and for households in the treatment group before the installation any energy efficiency measure; and 1 for all households in the treatment group from the year of the first installation of an energy efficiency measure either cavity walls or loft insulation.
My lags and leads are consistently being omitted due to 'collinearity' but I can't seem to fix it. The authors have managed to have these in their results so any help is greatly appreciated.
Using the 'tvdiff' command, they provide the command that executes the output. However, when attempting to replicate, I am consistently getting that my dummies are being omitted due to collinearity and I can't seem to adapt my code to account for this.
The current code is as follows:
Code:
gen lgascon=ln(gascon) gen lhdd=ln(hdd) gen lgaspriceunit=ln(gaspriceunit) gen activetreat=. replace activetreat=1 if (loftins_treat==1 | cavitywall_treat==1) replace activetreat=0 if (loftins_treat<=0 | cavitywall_treat<=0) summarize activetreat tvdiff lgascon activetreat2 lhdd lgaspriceunit, model(fe) pre(5) post(5) test_tt graph vce (cluster initialid)
My lags and leads are consistently being omitted due to 'collinearity' but I can't seem to fix it. The authors have managed to have these in their results so any help is greatly appreciated.
Comment