I am conducting a mediation analysis in stata v.17.0. I am using the medeff command. My data set, which is made up of a cohort of 600 young people has three survey time points. The loss to follow-up is about 50%. In order to account for this loss-to-follow-up, I am attempting to use probability weights within my medeff command, however I am receiving an error and am unsure how to successfully include these weights.
I have tried numerous ways of including it in the code, often receiving the error invalid syntax. An example is below.
When I tried it this way, I received an error saying 'ipw unknown weight type'
Any insights into this issue would be greatly appreciated!
I have tried numerous ways of including it in the code, often receiving the error invalid syntax. An example is below.
Code:
medeff (regress depression_m3 foodsec1) (probit anyhhviol_m6 foodsec1 depression_m3 interact_m_e) [pweight], treat(foodsec1 0 1) mediate(depression_m3) vce(robust) level(95) interact(interact_m_e) ipw(ipw)
Code:
medeff (regress depression_m3 foodsec1) (probit anyhhviol_m6 foodsec1 depression_m3 interact_m_e) [ipw], treat(foodsec1 0 1) mediate(depression_m3) vce(robust) level(95) interact(interact_m_e)
Comment