Mediation models in Stata are fit with the
sem does not support
svyset data, so instead you use
svy: gsem …). However,
gsem does not support
estat teffects which calculates direct, indirect and total effects.
This document shows how to manually calculate these effects using
Note that this is a case where all variables are continuous and all models are linear - we are only using
gsem for it’s support of
svy:, not it’s support of GLMs. Indirect effects are a more complicated topic in those models which we do not address here. Additionally, we’ll trust Stata to compute standard errors rather than getting into any sticky issues of bootstrapping.
First, let’s estimate the direct, indirect and total effects without the use of the survey design to show equivalence.
. webuse gsem_multmed (Fictional job-performance data)
The model we’ll be fitting is