Hello everyone! I am kind of new with Stata, so I apologize in advance if my questions are too basic.
I am trying to analyze the effect of a smoking ban in smoking rates in several cities. The issue is that the treatment in one city starts one period before than the treatment in the other cities. My data set looks like this:
City 1, 2, 3 and 4 had the treatment ... for city 1 the treatment started in 2012, for the rest cities, in 2014.
City 5, 6 and 7 are the control group.
I tried to follow this example http://www.princeton.edu/~otorres/DID101.pdf which works with several periods, but the treatment starts at the same period for all the countries. Hence, if I generate a variable period = 1 if year>= 2012, and then another variable treatment = 1 if city<=4 then for the cities that started treatment in 2014 will be wrong, since the interaction will show that they started treatment in 2012, and that's not the case.
I hope I was clear on my explanation, and I really appreciate your help.
Thank you.
I am trying to analyze the effect of a smoking ban in smoking rates in several cities. The issue is that the treatment in one city starts one period before than the treatment in the other cities. My data set looks like this:
city | year | smoking rates |
1 | 2006 | 30.11% |
1 | 2009 | 18.97% |
1 | 2012 | 9.93% |
1 | 2014 | 15.53% |
2 | 2006 | 18.93% |
2 | 2009 | 12.84% |
2 | 2012 | 7.15% |
2 | 2014 | 11.70% |
3 | 2006 | 25.02% |
3 | 2009 | 26.30% |
3 | 2012 | 17.80% |
3 | 2014 | 8.65% |
4 | 2006 | 26.34% |
4 | 2009 | 31.17% |
4 | 2012 | 15.82% |
4 | 2014 | 10.32% |
5 | 2006 | 22.42% |
5 | 2009 | 11.52% |
5 | 2012 | 6.39% |
5 | 2014 | 2.97% |
6 | 2006 | 8.58% |
6 | 2009 | 23.66% |
6 | 2012 | 19.32% |
6 | 2014 | 8.56% |
7 | 2006 | 33.16% |
7 | 2009 | 21.72% |
7 | 2012 | 17.34% |
7 | 2014 | 10.99% |
City 5, 6 and 7 are the control group.
I tried to follow this example http://www.princeton.edu/~otorres/DID101.pdf which works with several periods, but the treatment starts at the same period for all the countries. Hence, if I generate a variable period = 1 if year>= 2012, and then another variable treatment = 1 if city<=4 then for the cities that started treatment in 2014 will be wrong, since the interaction will show that they started treatment in 2012, and that's not the case.
I hope I was clear on my explanation, and I really appreciate your help.
Thank you.
Comment