I am doing a mediation analysis with -gsem- in Stata 15. The sem model includes models that are analysed with different methods: linear regression and fractional response models. The coefficients from these models are interpreted differently. In the return scalar lines below, coefficients from these different kinds of analyses are multiplied. Is this acceptable?
Code:
capture drop program bootcm program bootcm, rclass mi estimate, cmdok post: gsem (logAs logHg logCd logMn logPb c.Se_std##c.Se_std i.Maternal_edu i.Sex -> PCT_5mC if ADHDfrac!=., nocapslatent) /* */ (c.logAs##c.logAs c.logHg##c.logHg logCd logMn logPb Se_std i.Maternal_edu i.Sex PCT_5mC MADHD_SS Age_in_days -> ADHDfrac, family(binomial) link(logit)) (PCT_5mC -> ADHDfrac, family(binomial) link(logit)), vce(robust) return scalar logCd_indirect_PCT_5mC = _b[PCT_5mC:logCd]*_b[ADHDfrac:PCT_5mC] return scalar logHg_indirect_PCT_5mC = _b[PCT_5mC:logHg]*_b[ADHDfrac:PCT_5mC] return scalar logMn_indirect_PCT_5mC = _b[PCT_5mC:logMn]*_b[ADHDfrac:PCT_5mC] return scalar logPb_indirect_PCT_5mC = _b[PCT_5mC:logPb]*_b[ADHDfrac:PCT_5mC] return scalar Se_std_indirect_PCT_5mC = (_b[PCT_5mC:Se_std]+_b[PCT_5mC:c.Se_std#c.Se_std])*_b[ADHDfrac:PCT_5mC] return scalar logAs_indirect_PCT_5mC = _b[PCT_5mC:logAs]*_b[ADHDfrac:PCT_5mC] end bootstrap r(logCd_indirect_PCT_5mC)r(logHg_indirect_PCT_5mC)r(logMn_indirect_PCT_5mC)r(logPb_indirect_PCT_5mC)r(Se_std_indirect_PCT_5mC)r(logAs_indirect_PCT_5mC) if PCT_5mC!=.&ADHDfrac!=., /// reps(500) nodots: bootcm estat boot, bc percentile
0 Response to Mediation analysis with -gsem-
Post a Comment