Hi everyone,
I'm in need of some advice relating to using propensity score matching (PSM) in a difference-in-differences event study framework. I'm trying to examine the effect of a car industry closure on worker outcomes. I have an unbalanced panel from 2010-2022, and information on some worker characteristics in 2010 (age, education, occupation) and employment-related outcomes (salary, occupations, welfare benefits) in each year over the whole time period. To identify effects I am comparing the outcomes of those who worked in the car industry in 2010 (treatment), with those who worked in the construction and other manufacturing excluding car manufacturing (control). I want to use PSM to match treatment and control workers, using information on their age, education, and occupation in 2010, and estimate effects for each year, from 2011-2022, with 2010 used as the base year.
I'm currently using the user-contributed psmatch2 command for this purpose (Leuven & Sianesi). I'm aware that there are different matching methods to choose from (I have currently used the "ties" option which may not be the best), but my question at this point is on the general procedure of using this command to suit my setup. Below is an example of what I have done so far, where I first run psmatch2 on the treatment indicator variable and the matching variables and retain observations for which the generated "_weight" variable is not missing or zero, and then reshape the data to match my setup and run the regressions with the variable "_weight" included as weights. However I'm unsure if this approach is correct and wanted to double check.
I unfortunately can't share any data due to privacy reasons, but below is a snippet of the code I have used so far. Please let me know if this seems correct or not. Thank you very much.
I'm in need of some advice relating to using propensity score matching (PSM) in a difference-in-differences event study framework. I'm trying to examine the effect of a car industry closure on worker outcomes. I have an unbalanced panel from 2010-2022, and information on some worker characteristics in 2010 (age, education, occupation) and employment-related outcomes (salary, occupations, welfare benefits) in each year over the whole time period. To identify effects I am comparing the outcomes of those who worked in the car industry in 2010 (treatment), with those who worked in the construction and other manufacturing excluding car manufacturing (control). I want to use PSM to match treatment and control workers, using information on their age, education, and occupation in 2010, and estimate effects for each year, from 2011-2022, with 2010 used as the base year.
I'm currently using the user-contributed psmatch2 command for this purpose (Leuven & Sianesi). I'm aware that there are different matching methods to choose from (I have currently used the "ties" option which may not be the best), but my question at this point is on the general procedure of using this command to suit my setup. Below is an example of what I have done so far, where I first run psmatch2 on the treatment indicator variable and the matching variables and retain observations for which the generated "_weight" variable is not missing or zero, and then reshape the data to match my setup and run the regressions with the variable "_weight" included as weights. However I'm unsure if this approach is correct and wanted to double check.
I unfortunately can't share any data due to privacy reasons, but below is a snippet of the code I have used so far. Please let me know if this seems correct or not. Thank you very much.
Code:
set seed 123 psmatch2 treatment occ age educ, ties drop if (_weight==0|_weight==.) reshape long salary, i(id) rename _j time gen year=2010 if time==1 replace year=2011 if time==2 replace year=2012 if time==3 replace year=2013 if time==4 replace year=2014 if time==5 gen period10=(year==2010) gen period11=(year==2011) gen period12=(year==2012) gen period13=(year==2013) gen period14=(year==2014) gen treat10=period10*treatment gen treat11=period11*treatment gen treat12=period12*treatment gen treat13=period13*treatment gen treat14=period14*treatment xtreg salary i.year treat11 treat12 treat13 treat14 [aw=_weight], fe i(id) r

Comment