Help! I need somebody! My question is very basic but I’m absolutely lost.
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 on sexual crime in treatment countries compared to controls. The key independent variable “Prostitution Liberalization” is an indicator variable, which takes the value of one beginning in the year when a country legalizes prostitution, and zero otherwise. The dependent variable, “Rape Rate” measures the number of rape cases per 100,000 population recorded at the national level.
A comment by the journal editor highlights that there could be some interesting pairings: e.g., Denmark versus Sweden and Norway, Spain versus France, etc. He asks if the results hold up if I run separate matched samples.
So, I want to match each liberalized country to a non-treat country that is adjacent and has the closest rape rate in year t-1. Then I will re-do the baseline regression.
How to do this? Thank You in advance!
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long country int year byte prostitution_liberalization double raperate_2 5 2009 0 0 5 2010 0 3.3 5 2011 0 3.4 5 2012 0 2.2 5 2013 0 1.6 5 2014 0 1.2 5 2015 0 1.7 5 2016 0 2.59 5 2017 0 2.3399999141693115 6 1990 0 8.6 6 1991 0 7.4 6 1992 0 6.9 6 1993 0 7.4 6 1994 0 7.1 6 1995 0 7.03 6 1996 0 6.57 6 1997 0 6.36 6 1998 0 6.553398058252427 6 1999 0 6.155339805825243 6 2000 0 4.8543689320388355 6 2001 0 5.496870109546166 6 2002 0 6.401333202627194 6 2003 0 6.333751237 6 2004 0 6.734194859 6 2005 0 5.831338513 6 2006 0 5.166298267 6 2007 0 6.176355805 6 2008 0 5.097636113 6 2009 0 4.597817856 6 2010 0 5.3 6 2011 0 6.09 6 2012 0 6.06 6 2013 0 5.67 6 2014 0 6.43 6 2015 0 5.56 6 2016 0 6.15 6 2017 0 5.650000095367432 7 1990 0 9.5 7 1991 0 10.3 7 1992 0 10.8 7 1993 0 9.6 7 1994 0 9.2 7 1995 0 8.42 7 1996 0 7.37 7 1997 0 8.23 7 1998 0 7.885304659498208 7 1999 1 8.967851099830796 7 2000 1 9.31409295352324 7 2001 1 9.199477514461654 7 2002 1 9.304056568663938 7 2003 1 8.76592329 end label values country country label def country 5 "Cyprus", modify label def country 6 "CzechRepublic", modify label def country 7 "Denmark", modify
P.S. “Prostitution Liberalization” takes the value of one beginning in the year when a country legalizes prostitution, and zero otherwise. On the other hand, “Prostitution dummy” takes the value of one if prostitution is legal in country i in a given year, and zero otherwise (for some countries it is always one, for others – always zero).
0 Response to Match each treated country to a non-treat country that is adjacent and has the closest crime rate in year t-1
Post a Comment