Hi everyone,
I am trying to run a matching estimators analysis - say teffects nnmatch (dep_variable x_covariate) (treatment) but filtering the data for different U.S. states - so I would have
teffects nnmatch (dep_variable x_covariate) (treatment) if state = "California"
teffects nnmatch (dep_variable x_covariate) (treatment) if state = "North Carolina"
etc..
My problems are the following:
(1) for some states some of the observations don't return feasible matches and the message "use option osample() to identify all
observations with deficient matches" shows up. Ideally I would like to simply exclude the unmatched observations from my input and simply find the ATE and ATET without including them. Is it possible? The error message suggests to use osample() but I don't know how would be the syntax of the code (I am quite novice to Stata... only used MATLAB until yesterday).
(2) is there any way for me to "loop" across different states? Like in MATLAB I would do a for s=1:50 and then call the vector with the strings for the state inside the loop (like state_string(s)) as the argument for the matching function.
Thank you very much for your help.
I am trying to run a matching estimators analysis - say teffects nnmatch (dep_variable x_covariate) (treatment) but filtering the data for different U.S. states - so I would have
teffects nnmatch (dep_variable x_covariate) (treatment) if state = "California"
teffects nnmatch (dep_variable x_covariate) (treatment) if state = "North Carolina"
etc..
My problems are the following:
(1) for some states some of the observations don't return feasible matches and the message "use option osample() to identify all
observations with deficient matches" shows up. Ideally I would like to simply exclude the unmatched observations from my input and simply find the ATE and ATET without including them. Is it possible? The error message suggests to use osample() but I don't know how would be the syntax of the code (I am quite novice to Stata... only used MATLAB until yesterday).
(2) is there any way for me to "loop" across different states? Like in MATLAB I would do a for s=1:50 and then call the vector with the strings for the state inside the loop (like state_string(s)) as the argument for the matching function.
Thank you very much for your help.
Comment