Hello, I am new to the forum and to stata. I have a problem with a diff in diff analysis of an event study. I measured air quality for 3 different cities and have data from 1.1.2018. City A got a treatment on 1.06.2018, and has 15 stations in total and 5 treated. City B got the same treatment at 1.6.2019, and has 4 stations with 3 treated stations. City C was not treated. Do you know how I can run this?
I tried it with this Code: "csdid NO2, ivar(Stationcode) time(date) gvar(treated) method(dripw) wboot rseed(1)"
NO2 is my main variable, Stationcode is the number of each station, the date variable is in Stata written like this: "01mar2018" and the treated variable is either 1 or 0, 1 for treated and 0 for untreated.
I receive the error code:
"Gvar max value is 1 and there are no periods available before that treatment
Verify that Gvar is correctly defined
request may not be combined with by
r(190);"
What is wrong with my Code?
I hope you can help me.
Best wishes and many thanks in advance
Tuck
I tried it with this Code: "csdid NO2, ivar(Stationcode) time(date) gvar(treated) method(dripw) wboot rseed(1)"
NO2 is my main variable, Stationcode is the number of each station, the date variable is in Stata written like this: "01mar2018" and the treated variable is either 1 or 0, 1 for treated and 0 for untreated.
I receive the error code:
"Gvar max value is 1 and there are no periods available before that treatment
Verify that Gvar is correctly defined
request may not be combined with by
r(190);"
What is wrong with my Code?
I hope you can help me.
Best wishes and many thanks in advance
Tuck
Comment