Sobel test of mediation using R
sobel {multilevel}
Estimate Sobel's (1982) indirect test for mediation. The function provides an estimate of the magnitude of the indirect effect, Sobel's first-order estimate of the standard error associated with the indirect effect, and the corresponding z-value. The estimates are based upon three models as detailed on page 84 of MacKinnon, Lockwood, Hoffman, West and Sheets (2002).
mediation.test {bda}
To compute statistics and p-values for the Sobel test. Results for three versions of “Sobel test” are provided: Sobel test, Aroian test and Goodman test.
##########################
"Sobel test of mediation"
#########################
require(multilevel)
require(bda)
data(bh1996)
#A small but significant indirect effect indicates leadership mediates
#the relationship between work hours and well-being.
# sobel(pred,med,out)
sobel(bh1996$HRS,bh1996$LEAD,bh1996$WBEING)
# mediation.test(mv,iv,dv)
mediation.test(bh1996$LEAD,bh1996$HRS, bh1996$WBEING)
sobel test不太好,毕竟很多时候参数的乘积项并不服从正态分布,除非参数间都是正交关系,所以用基于正态检验的sobel有漏洞,目前较为好的办法有bootstrap还有bayesian来做mediation analysis
多谢回复。是否有使用r的例子?
Mackinnon指出中介效应的检验方法可以分成三类,包括依次检验回归系数的因果步骤法(casual steps approach) ,检验c-c'显著性的系数差异法(difference in coefficients) 和检验ab 显著性的系数乘积法(products of coefficients)。Baron & Kenny提出的casual steps是大家很熟悉的方法了,但最近几年颇受批评;而系数乘积法可分为两派,一个是默认效应量的抽样分布为正态分布的sobel test,还有一种是不对称抽样区间法,包括最近颇受关注的蒙特卡洛法,bootstrap法,MCMC法,都是通过检验算法构造的置信区间不包含0来做中介效应检验。Rmediation提供了通过蒙特卡洛积分计算乘积项的置信区间,检验思路如上。
> 我来回应