I want to create an event-study using a triple-differences. I want to estimate the effect of closing a school on the local economy. My treatment group are municipalities with one school who lost it, and the two control groups are municipalities with one school (that did not lost it) and municipalities without a school.
Here is my Stata code:
However, after I run the regression, I obtain the following warnings:
What am I doing wrong?
Here is an example of my data:
Here is my Stata code:
Code:
gen event_time = time - ytreated // Relative time to event gen post = event_time >= 0 // Indicator for post-treatment period // Create event dummies for each lead/lag, omitting the baseline (usually t = -1) gen lead2 = event_time == 2 gen lead1 = event_time == 1 gen event0 = event_time == 0 gen lag1 = event_time == -1 gen lag2 = event_time == -2 xtreg economy lag2##i.closed##i.school lag1##i.closed##i.school lead1##i.closed##i.school lead2##i.closed##i.school, fe vce(cluster commune2)
Code:
note: 1.closed omitted because of collinearity. note: 1.lag2#0b.closed identifies no observations in the sample. note: 1.lag2#1.closed omitted because of collinearity. note: 1.school omitted because of collinearity. note: 1.lag2#0b.school identifies no observations in the sample. note: 1.lag2#1.school omitted because of collinearity. note: 1.closed#0b.school identifies no observations in the sample. note: 1.closed#1.school omitted because of collinearity. note: 0b.lag2#1.closed#0b.school identifies no observations in the sample. note: 1.lag2#0b.closed#0b.school identifies no observations in the sample. note: 1.lag2#0b.closed#1.school identifies no observations in the sample. note: 1.lag2#1.closed#0b.school identifies no observations in the sample. note: 1.lag2#1.closed#1.school omitted because of collinearity. note: 1.lag1#0b.closed identifies no observations in the sample. note: 1.lag1#1.closed omitted because of collinearity. note: 1.lag1#0b.school identifies no observations in the sample. note: 1.lag1#1.school omitted because of collinearity. note: 0b.lag1#1.closed#0b.school identifies no observations in the sample. note: 1.lag1#0b.closed#0b.school identifies no observations in the sample. note: 1.lag1#0b.closed#1.school identifies no observations in the sample. note: 1.lag1#1.closed#0b.school identifies no observations in the sample. note: 1.lag1#1.closed#1.school omitted because of collinearity. note: 1.lead1#0b.closed identifies no observations in the sample. note: 1.lead1#1.closed omitted because of collinearity. note: 1.lead1#0b.school identifies no observations in the sample. note: 1.lead1#1.school omitted because of collinearity. note: 0b.lead1#1.closed#0b.school identifies no observations in the sample. note: 1.lead1#0b.closed#0b.school identifies no observations in the sample. note: 1.lead1#0b.closed#1.school identifies no observations in the sample. note: 1.lead1#1.closed#0b.school identifies no observations in the sample. note: 1.lead1#1.closed#1.school omitted because of collinearity. note: 1.lead2#0b.closed identifies no observations in the sample. note: 1.lead2#1.closed omitted because of collinearity. note: 1.lead2#0b.school identifies no observations in the sample. note: 1.lead2#1.school omitted because of collinearity. note: 0b.lead2#1.closed#0b.school identifies no observations in the sample. note: 1.lead2#0b.closed#0b.school identifies no observations in the sample. note: 1.lead2#0b.closed#1.school identifies no observations in the sample. note: 1.lead2#1.closed#0b.school identifies no observations in the sample. note: 1.lead2#1.closed#1.school omitted because of collinearity.
Here is an example of my data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(lag2 lag1 event0 lead1 lead2 closed school) 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 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