Hello,
I am trying to run a DiD analysis under Stata 17. I have a sample of countries, some have implemented a certain policy and others did not. I am thus interested in the effect of the treatment on the outcome variable y, considering also a continous control variable x.
The code I am using is the following:
treatment equals 1 for treated countries in the post-treatment period. The results I obtain are the following:
First question, how do I interpret the ATET coefficient of -5.362 (assuming it's p-value was meaningful, which is not the case in this example)? In levels or differences? Does this mean that treated compared to non-treated countries have a level of y 5.362 smaller in the post-treatment period ?
In a second step, I am concerned that the control variable x may modulate the effect of the treatment (thus acting like a second treatment, but continous). It should mean that my treatment has an independent effect for all treated countries plus a conditionnal effect depending on x.
I am running the following code
Where interact=treatment#c.x which basically equals x for treated countries in the post-treatment period and 0 otherwise.
The results I obtain are the following:
Second question: Previous results are slightly different if I run the regression "manually" with the reg command and constructing all dummies and interactions. This is probably due to the DDD nature with two treatments, whereas I am only considering technically one in the didregress code above. Running a proper DDD regression, according to the Stata manual, would require the group identification based on two variables. Here is where I am l lost, I should add something to group (country ?) but what as my x variable is continuous?
Here comes my third question: how do I interpret the overall effect of the treatment? I would like to be able to give a numerical interpretation.
My intuition is that it should be something like -21.610 + 0.250*x (or difference in x?).
For a 1% change in x, the effect for treated compared to non-treated countries is -21.610+0.25 ?
I am trying to compute fitted values but I am confused with the different constants and the values I should consider post-treatment for the different variables.
Is there a margins command that might work in this case?
Thank you.
I am trying to run a DiD analysis under Stata 17. I have a sample of countries, some have implemented a certain policy and others did not. I am thus interested in the effect of the treatment on the outcome variable y, considering also a continous control variable x.
The code I am using is the following:
Code:
didregress(y x) (treatment), group(country) aeq time(date) aggregate(standard) vce(hc2)
Code:
Difference-in-differences regression Number of obs = 323 No. of clusters = 54 Data type: Repeated cross-sectional Robust HC2 y Coefficient std. err. t P>t [95% conf. interval] ATET treatment (1 vs 0) -5.362211 4.344244 -1.23 0.228 -14.30149 3.577068 Controls x .0205252 .0264968 0.77 0.442 -.0326207 .0736711 time 2 -1.2332 1.174549 -1.05 0.299 -3.589046 1.122646 3 -3.264266 1.328192 -2.46 0.017 -5.928282 -.6002503 4 -3.873446 2.512182 -1.54 0.129 -8.912246 1.165354 5 -6.988004 2.502053 -2.79 0.007 -12.00649 -1.969521 6 -10.07839 2.599223 -3.88 0.000 -15.29177 -4.86501 _cons 99.45413 2.891358 34.40 0.000 93.6548 105.2535 Note: ATET estimate adjusted for covariates, group effects, and time effects.
In a second step, I am concerned that the control variable x may modulate the effect of the treatment (thus acting like a second treatment, but continous). It should mean that my treatment has an independent effect for all treated countries plus a conditionnal effect depending on x.
I am running the following code
Code:
didregress(y x interact) (treatment), group(id) aeq time(time) aggregate(standard) vce(hc2)
The results I obtain are the following:
Code:
Difference-in-differences regression Number of obs = 323 No. of clusters = 54 Data type: Repeated cross-sectional Robust HC2 y Coefficient std. err. t P>t [95% conf. interval] ATET treatment (1 vs 0) -21.61052 7.847285 -2.75 0.021 -39.15799 -4.063058 Controls x .0001921 .021884 0.01 0.993 -.0437016 .0440859 interact .2504623 .0797336 3.14 0.003 .090537 .4103876 time 2 -1.22727 1.172187 -1.05 0.300 -3.578378 1.123839 3 -3.434767 1.360182 -2.53 0.015 -6.162945 -.7065882 4 -4.743271 2.379988 -1.99 0.051 -9.516922 .0303799 5 -7.462153 2.367444 -3.15 0.003 -12.21065 -2.713661 6 -10.84555 2.541711 -4.27 0.000 -15.94357 -5.74752 _cons 101.5432 2.626231 38.67 0.000 96.27567 106.8108 Note: ATET estimate adjusted for covariates, group effects, and time effects.
Here comes my third question: how do I interpret the overall effect of the treatment? I would like to be able to give a numerical interpretation.
My intuition is that it should be something like -21.610 + 0.250*x (or difference in x?).
For a 1% change in x, the effect for treated compared to non-treated countries is -21.610+0.25 ?
I am trying to compute fitted values but I am confused with the different constants and the values I should consider post-treatment for the different variables.
Is there a margins command that might work in this case?
Thank you.