Dear Statalist User,
I am currently writing my master's thesis on the effect of the Kyoto Protocol on greenhouse gas emissions (GHGe) using Difference-in-Differences estimation. I use a dummy variable named "kyoto," which is assigned a value of 1 if the country signed the protocol and 0 otherwise, with 2005 designated as the treatment year. I aim to employ propensity score matching, using pre-treatment GHGe, and have prepared the following STATA codes:
The issue I am encountering relates to my wish to match the sample using pre-treatment variables. However, for the Difference-in-Differences (DiD) regression, I aim to include both pre- and post-treatment periods. The problem arises when I run the DiD regression: it appears not to utilize the matched sample, even when I use the condition "if _treat == 1 | _n1 > 0". This becomes evident when I run the same regression without the "if _treat == 1 | _n1 > 0" condition (to illustrate the baseline scenario not using the matched sample), and I obtain identical results as when attempting to use the matched sample.
In summary, I suspect there is an issue with the part "if _treat == 1 | _n1 > 0" of my DiD command, as it fails to utilize the matched sample. When I replace "if _treat == 1 | _n1 > 0" with "_treated == 1" (which is a variable I obtain from psmatch2, indicating treated and untreated units), my regression only uses pre-treatment periods, resulting in the omission of my post-treatment variables.
I sincerely hope someone can provide assistance, and I appreciate any advice!
Kind regards
Marie Louise
I am currently writing my master's thesis on the effect of the Kyoto Protocol on greenhouse gas emissions (GHGe) using Difference-in-Differences estimation. I use a dummy variable named "kyoto," which is assigned a value of 1 if the country signed the protocol and 0 otherwise, with 2005 designated as the treatment year. I aim to employ propensity score matching, using pre-treatment GHGe, and have prepared the following STATA codes:
Code:
* Generating pre 2005 average GHG emissions gen growth_GHGe_pre2005 = growth_GHGe if Year < 2005 * Calculating the mean of these GHG emissions for each country egen growth_GHGepre2005 = mean(growth_GHGe_pre2005), by(CountryCode) * Replace missing values with zero replace growth_GHGepre2005 = 0 if missing(growth_GHGepre2005) *Use the psmatch2 command to perform propensity score matching without replacement using nearest neighbor and caliper(0.05) psmatch2 kyoto growth_pop growth_gdppc growth_gdppc2, neighbor(1) caliper(0.05) out(growth_GHGe_pre2005) common *Generating the post-treatment indicator variable gen post05 = Year > 2005 *Generating the interaction term for the DiD estimate gen treatXpost05 = kyoto * post05 *Run DiD regression on matched sample regress ln_GHGe kyoto post05 treatXpost05 ln_gdppc ln_gdppc2 ln_pop i.Year i.CC_num if _treat == 1 | _n1 > 0, robust
In summary, I suspect there is an issue with the part "if _treat == 1 | _n1 > 0" of my DiD command, as it fails to utilize the matched sample. When I replace "if _treat == 1 | _n1 > 0" with "_treated == 1" (which is a variable I obtain from psmatch2, indicating treated and untreated units), my regression only uses pre-treatment periods, resulting in the omission of my post-treatment variables.
I sincerely hope someone can provide assistance, and I appreciate any advice!
Kind regards
Marie Louise