Dear StataList-ers,
Help! I need somebody!
I am applying a difference-in-differences (DID) test design in multiple treatment groups and multiple time periods. I examine the before-after effect of prostitution liberalization/ prohibition on sexual crime.
The journal editor suggests that I look at Andrew Goodman-Bacon’s work showing that standard DD estimates can be biased when there is heterogeneity in the timing of treatment. He recommends that I address this potential source of bias as in my case treatment happens during different years.
I tried to run bacondecomp but I get an error “Panel must be strongly balanced”. I do have some missing years (no data for the dependent variable) – what should I do? How to proceed?
Another issue: the help file for bacondecomp says the “treatment can only turn from zero to one during the time period examined”. My key independent variable “Liberalization” (or “Prohibition”) is an indicator variable, which takes the value of one beginning in the year when a country liberalizes commercial sex (or prohibits), and zero otherwise. However, for some countries, the variable is always zero. Is this okay?
Below is an example from the “liberalization” sub-sample:
I'm stuck. Thanks in advance!
Greetings
Help! I need somebody!
I am applying a difference-in-differences (DID) test design in multiple treatment groups and multiple time periods. I examine the before-after effect of prostitution liberalization/ prohibition on sexual crime.
The journal editor suggests that I look at Andrew Goodman-Bacon’s work showing that standard DD estimates can be biased when there is heterogeneity in the timing of treatment. He recommends that I address this potential source of bias as in my case treatment happens during different years.
I tried to run bacondecomp but I get an error “Panel must be strongly balanced”. I do have some missing years (no data for the dependent variable) – what should I do? How to proceed?
Another issue: the help file for bacondecomp says the “treatment can only turn from zero to one during the time period examined”. My key independent variable “Liberalization” (or “Prohibition”) is an indicator variable, which takes the value of one beginning in the year when a country liberalizes commercial sex (or prohibits), and zero otherwise. However, for some countries, the variable is always zero. Is this okay?
Below is an example from the “liberalization” sub-sample:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long country int year byte prostitution_prohibition double raperate_2 float(treated nontreated) double(ln_population unemploymentrate) 2 2015 0 25.4 0 1 16.2347469329834 8.5 2 2016 0 29.49 0 1 16.24119758605957 7.3 2 2017 0 30.139999389648438 0 1 16.244728088378906 6.2 3 1990 0 4.6 0 1 15.986540794372559 2.9 3 1991 0 8.6 0 1 15.975295066833496 6.78 3 1992 0 8.9 0 1 15.966745376586914 13.24 3 1993 0 9.5 0 1 15.953794479370117 15.84 3 1994 0 8.7 0 1 15.950831413269043 14.05 3 1995 0 9 0 1 15.947001457214355 11.37 3 1996 0 9.18 0 1 15.94192123413086 10.988 3 1997 0 9.31 0 1 15.936685562133789 14.023 3 1998 0 9.33753179120746 0 1 15.929739952087402 12.367 3 1999 0 9.01559454191033 0 1 15.923341751098633 13.79 3 2000 0 7.260963687834885 0 1 15.91853141784668 18.134 3 2001 0 7.5 0 1 15.913463592529297 17.514 3 2002 0 6.9 0 1 15.87841796875 17.416 3 2003 0 7.793251045 0 1 15.870340347290039 13.857 3 2004 0 6.791472273 0 1 15.862577438354492 12.192 3 2005 0 5.207313756 0 1 15.855245590209961 10.177 3 2006 0 4.031461001 0 1 15.847516059875488 9.022 3 2007 0 2.944917093 0 1 15.840056419372559 6.935 3 2008 0 3.451309271 0 1 15.83281135559082 5.664 3 2009 0 3.261442825 0 1 15.826020240783691 6.878 3 2010 0 3.21 0 1 15.819927215576172 10.306 3 2011 0 2.68 0 1 15.812850952148437 11.35 3 2012 0 2.81 0 1 15.807106971740723 12.379 3 2013 0 6.43 0 1 15.80126667022705 13.038 3 2014 0 7.89 0 1 15.795915603637695 11.524 3 2015 0 6.13 0 1 15.789896965026855 9.1 3 2016 0 1.78 0 1 15.783182144165039 6.7 3 2017 0 2 0 1 15.775886535644531 5.8 4 1990 0 3.4 1 0 15.378392219543457 11.1 4 1991 0 2.6 1 0 15.380407333374023 13.159 4 1992 0 2.3 1 0 15.340667724609375 15.253 4 1993 0 3.1 1 0 15.331905364990234 14.775 4 1994 0 2 1 0 15.351335525512695 14.48 4 1995 0 1.65 1 0 15.354288101196289 14.5 4 1996 0 1.97 1 0 15.337464332580566 9.952 4 1997 0 2.24 1 0 15.326900482177734 9.906 4 1998 0 2.77489042594568 1 0 15.32773494720459 11.637 4 1999 0 2.3774091269650772 1 0 15.325671195983887 13.425 4 2000 1 2.557077625570776 1 0 15.319084167480469 15.425 4 2001 1 3.8771851187808157 1 0 15.273056983947754 15.975 4 2002 1 3.6954087346024638 1 0 15.275402069091797 15.275 4 2003 1 4.779442205 1 0 15.27537727355957 14.25 4 2004 1 3.708263494 1 0 15.275456428527832 13.95 4 2005 1 3.196768292 1 0 15.27664852142334 13.075 4 2006 1 4.217609716 1 0 15.27702522277832 11.6 4 2007 1 3.660193922 1 0 15.277267456054687 9.6 4 2008 1 4.254946432 1 0 15.276905059814453 8.55 4 2009 1 2.924597086 1 0 15.27640151977539 8.925 end label values country country label def country 2 "Belgium", modify label def country 3 "Bulgaria", modify label def country 4 "Croatia", modify
Greetings