Hello All,

I am doing a difference-in-difference analysis. I need to create an identifier, or a variable, that would help me to identify the treatment and control countries for a certain episode. For this analysis, three baseline variables are: country (149 of them), year (1970-2014) and is liberalization variable which is equal to 1 during liberalization, and 0 otherwise.

I am looking at 4-year episodes of liberalization, meaning that the liberalization period has to last more than 4 years. For doing the analysis, I am taking the average of four years before the liberalization period, which is POST=0 and 4-years after, which is POST=1. Assuming that India, Vietnam and COlombia had liberalization in the same year, say 1991, I need to average the treatment countries (India, Vietnam, Colombia for example), from 1987 to 1990 (which is POST=0) and 1991-1994 (POST=1). This is how I am planning to identify treatment for each episode. In addition to that, countries can have more than one episode of liberalization, as long as the gap between two liberalization period is 2 years. Lastly, when liberalization occurs within the first two years of the dataset, we do not count that as an episode, so in my case, I will not be looking at any liberalization starting in 1972. And given that I need 4-year window before liberalization, I have to look at liberalizations starting in 1977. So I am looking for coding for identifying episodes of liberalization each year from 1977 to 2010, for control and treatment countries.

Thank you,
Ridwan Mosharraf