stata中可以用sgmediation命令来进行中介效应的检验
Sobel-Goodman mediation tests
sgmediation depvar [if exp] [in range] , mv:(mediatorvar) iv(indvar) [ cv(covarlist) quietly ]
Description
The purpose of the Sobel-Goodman tests are to test whether a mediator carries the influence of an IV to a DV.
A variable may be considered a mediator to the extent to which it carries the influence of a given independent variable (IV) to a given dependent variable (DV). Generally speaking,
mediation can be said to occur when (1) the IV significantly affects the mediator, (2) the IV significantly affects the DV in the absence of the mediator, (3) the mediator has a
significant unique effect on the DV, and (4) the effect of the IV on the DV shrinks upon the addition of the mediator to the model.
Options
cv(covarlist) Optional list of covariate variables.
quietly Suppresses the individual regression output.