I'm having a problem commanding a local to do a function. The idea of the whole loop is to match a control firm to a treatment firm, append onto the matched_pairs dataset, and then drop the control firm such that it cannot match to any other treatment firms. The code is shown below:
Code:
append using matched_pairs.dta, nolabel save matched_pairs.dta, replace local abc bncusip == _N use matching_firms`i'.dta, replace drop if bncusip == abc, force save matching_firms`i'.dta, replace
Can anyone help fixing this local command? Thank you!
0 Response to Using Local in a Loop
Post a Comment