Hello stata experts,
I am relatively new to stata and want to regress a difference in difference estimator. With this I want to estimate the effect of a political treatment within Germany. The treatment was introduced by different federal states at different times.
I have data regarding one pre-period (1998), when non of the federal states had the treatment. One post-period (2007) when all states in the treatment group have the treatment and on third period. In this third period (2004) some of the states in the treatment group have introduced the measure and some did not.
For a normal DID estimator I would simply define a post dummy and a treatment dummy as well as an interaction term, but I do not know how to include the third period.
My idea was to ad a post dummy for every federal state like:
gen Post_nrw=0
replace Post_nrw=1 if Time>=2004
gen Post_hb=0
replace Post_hb=1 if Time>=2006
gen Post_sh=0
replace Post_sh=1 if Time>=2006
gen Post_be=0
replace Post_be=1 if Time>=2004
Then I woud define a treatment group in which al states that adopt the treatment are included and calculate an interaction term for every post dummy like:
gen interaction_nrw= Treatmentgroup * Post_nrw
gen interaction_hb= Treatmentgroup * Post_hb
gen interaction_sh= Treatmentgroup * Post_sh
gen interaction_be= Treatmentgroup * Post_be
and then I would regress:
Y = Post_nrw BundesTreatmentgroup interaction_nrw Post_hb BundesTreatmentgroup interaction_hb... and so on for every federal state.
Can you tell me if it is possible to calculate a DID estimator like this and if not how it is possible to include the third period?
Thank you in advance.
Kind regards,
Hilz
I am relatively new to stata and want to regress a difference in difference estimator. With this I want to estimate the effect of a political treatment within Germany. The treatment was introduced by different federal states at different times.
I have data regarding one pre-period (1998), when non of the federal states had the treatment. One post-period (2007) when all states in the treatment group have the treatment and on third period. In this third period (2004) some of the states in the treatment group have introduced the measure and some did not.
For a normal DID estimator I would simply define a post dummy and a treatment dummy as well as an interaction term, but I do not know how to include the third period.
My idea was to ad a post dummy for every federal state like:
gen Post_nrw=0
replace Post_nrw=1 if Time>=2004
gen Post_hb=0
replace Post_hb=1 if Time>=2006
gen Post_sh=0
replace Post_sh=1 if Time>=2006
gen Post_be=0
replace Post_be=1 if Time>=2004
Then I woud define a treatment group in which al states that adopt the treatment are included and calculate an interaction term for every post dummy like:
gen interaction_nrw= Treatmentgroup * Post_nrw
gen interaction_hb= Treatmentgroup * Post_hb
gen interaction_sh= Treatmentgroup * Post_sh
gen interaction_be= Treatmentgroup * Post_be
and then I would regress:
Y = Post_nrw BundesTreatmentgroup interaction_nrw Post_hb BundesTreatmentgroup interaction_hb... and so on for every federal state.
Can you tell me if it is possible to calculate a DID estimator like this and if not how it is possible to include the third period?
Thank you in advance.
Kind regards,
Hilz
Comment