Probability weights in random effects models for logistic regression in month-year panel
Hello,
I am attempting to estimate the effects of a treatment on my outcome using random effects and xtlogit. Both the treatment and outcome are binary.
For context, before I get to the question: The original dataset is a month-year panel (01/01/2010 - 31/12/2016) at the individual level, with fixed socioeconomic covariates. There are ~3 million individuals and ~85 million observations.
I have ran the following regression on the panel data:
However, as only ~2000 of the individuals have been treated, I would like to run the same regression on a matched sample where each treated individual is matched to 50 untreated controls.
I have started with PSM using psmatch2:
While I understand the output, I would like to run the regression on all the treated individuals and each of their respective 50 controls. i.e. I need to create a sample of only the matched treated and untreated individuals to then merge on their unique identifiers back into the original panel dataset to run the regression on just the matched (panel) sample. The only way I can see this working is keeping only the relevant unique identifiers but I cannot figure out how to do this.
I previously followed this: https://www.ssc.wisc.edu/sscc/pubs/stata_psmatch.htm and tried some trouble shooting approaches - below. I am attempting to integrate probability weights to run my regression on only the matched sample following propensity score matching. However, I understand that xtreg does not support pweights or aweights. Nevertheless, this still does not resolve the problem of using only the matched sample and identifying on the relevant matched individuals to keep in the panel dataset to run the regression on only the 2000 treated and each of their 50 matches.
To summarise, my question is, how do I get just the matched sample after psmatch2 to then merge them back into my panel dataset?
For reference, I use Stata 18.
Thank you for taking the time to read this. I appreciate any help and happy to answer any questions.
Bw, Sophia
Hello,
I am attempting to estimate the effects of a treatment on my outcome using random effects and xtlogit. Both the treatment and outcome are binary.
For context, before I get to the question: The original dataset is a month-year panel (01/01/2010 - 31/12/2016) at the individual level, with fixed socioeconomic covariates. There are ~3 million individuals and ~85 million observations.
I have ran the following regression on the panel data:
Code:
xtlogit phc_urb_vio_risk_ever vio_ever_exp i.sex i.race_skinc i.age_group i.education_highest i.hh_income i.insurance i.bf i.year i.month re vce(robust) or
I have started with PSM using psmatch2:
Code:
* (1) estimate propensity score and match psmatch2 vio_ever_exp (i.sex i.race_skinc i.age_group i.education_highest i.hh_income i.insurance i.bf), neighbor(50) caliper(0.05) common logit * (2) evaluate match graphically psgraph * (3) evaluate match with statistical tests pstest i.sex i.race_skinc i.age_group i.education_highest i.hh_income i.insurance i.bf
I previously followed this: https://www.ssc.wisc.edu/sscc/pubs/stata_psmatch.htm and tried some trouble shooting approaches - below. I am attempting to integrate probability weights to run my regression on only the matched sample following propensity score matching. However, I understand that xtreg does not support pweights or aweights. Nevertheless, this still does not resolve the problem of using only the matched sample and identifying on the relevant matched individuals to keep in the panel dataset to run the regression on only the 2000 treated and each of their 50 matches.
Code:
* running regression on matched sample TEST xtlogit phc_urb_vio_risk_ever vio_ever_exp i.sex i.race_skinc i.age_group i.education_highest i.hh_income i.insurance i.bf i.year i.month [fweight=_weight], re vce(robust) or // error: may not use noninteger frequency weights r(401); * xtlogit does not accept non-integer frequency weights (fweight) * instead use probability weights (pweight) or analytic weights (aweight) xtlogit phc_urb_vio_risk_ever vio_ever_exp i.sex i.race_skinc i.age_group i.education_highest i.hh_income i.insurance i.bf i.year i.month [pweight=_weight], re vce(robust) or // error: pweight not allowed for fixed- and random-effects cases r(101); * xtlogit does not support pweight when using random-eff or fixed-eff models * alt approach is to use melogit, which allows weights and random eff melogit phc_urb_vio_risk_ever vio_ever_exp i.sex i.race_skinc i.age_group i.education_highest i.hh_income i.insurance i.bf i.year i.month [pweight=_weight] || id_linha_fa:, vce(robust) or
For reference, I use Stata 18.
Thank you for taking the time to read this. I appreciate any help and happy to answer any questions.
Bw, Sophia