邮箱: simonzhanyf@163.com

Source: Mehmetoglu M. Medsem: A Stata package for statistical mediation analysis[J]. International Journal of Computational Economics and Econometrics, 2018, 8(1): 63-78. -Link-

目录

3. medsem 命令介绍

4. 使用 medsem 进行中介效应分析的示例

5. 结语

6. 参考资料

1. 背景介绍

在分析变量 对 的影响途径和机制时,「中介效应分析」是一个重要的工具。

在连享会以往的推文中,主要介绍了回归分析 (regression) 框架下的中介效应分析方法。但相比 SEM (结构方程模型) 框架,回归框架下估计的中介效应标准误更大,参数估计不准确 (Iacobucci et al., 2007),且当使用 Sobel 检验时需要假定 服从正态分布(Zhao et al., 2010) ,在实际使用中未必能满足。

故而,本文我们将介绍 Mehmetoglu(2018)提供的 Stata 命令 medsem,它是基于结构方程模型 (SEM) 的中介效应分析方法,能弥补上述缺陷。

2. 中介效应分析2.1 BK 方法

在介绍 SEM 方法估计中介效应前,我们首先需要了解社会科学家通常采用的进行中介效应分析的 Baron 和 Kenny (1986) 的方法 (后文简称 BK 方法) 。BK 方法包括 4 个步骤。下面首先对这些步骤予以说明,并相应地在 Figure 1 中给出图解。

结构方程模型(sem)_结构方程模型rmsea_sem结构方程模型是什么

部分中介意味着路径 的减少,当减少多少,即 多大时可以说存在部分中介效应呢?Sobel (1987) 提出 z 检验,使用如下方程提供 的标准误。值得说明的是,检验 等价于检验中介路径()(Iacobucci et al., 2007)。

其中:

2.2 BK 方法的改进

Iacobucci et al. (2007) 通过一系列蒙特卡洛模拟证明,与使用结构方程模型 (SEM) 相比,使用回归分析 (REG) 有严重的缺陷sem结构方程模型是什么,即回归分析得到的中介路径系数的标准误始终比 SEM 方法更大,因为 SEM 方法能对所有模型参数同时进行估计。SEM 方法的另一个优点是,它本身有助于中介效应分析,包括多项目量表 (multi-item scales) (也称为潜在变量)。因此 SEM 方法应是进行中介效应分析的标准框架。于是 Iacobucci et al. (2007)通过改进 BK 方法,提出了通过 SEM 进行中介效应分析的一系列步骤。

Step 2 : 计算 Sobel Z 值以检验中介效应相对于直接效应的大小。

Step 3 : 报告估计结果,分为三种:不存在中介 (no), 部分中介 (partial) 或 完全中介 (full mediation)。

2.3 BK 方法的替代方法2.3.1 基于 Bootstrap 的检验方法

Zhao et al.(2010) 认同 Iacobucci et al.(2007) 的观点:SEM 方法是进行中介效应分析的最佳框架。

他们进一步建议 BK 方法(也就是三个回归方程 + Sobel 检验) 用一个检验来代替:中介效应 (见 Figure 1 (d)) 的「自抽样检验」(bootstrap test)。他们认为,中介效应分析最重要的是基于自助检验,中介效应在统计上显著。因此 Zhao et al.(2010)也提出了检验中介效应假设的一系列步骤。

Zhao et al.(2010) 认为,之所以对中介效应使用自助检验,原因在于,当中介效应 的样本分布高度有偏时,Sobel 检验由于需要假定近似正态的对称分布,因而检验力度低 (Kenny, 2016),即使 a 和 b 均为正态分布时,情况也是如此。

自助法(bootsrapping) 生成统计量 (这里为中介效应 )的经验样本分布,这一分布来自于计算和收集取代原始样本数据的 n 个样本 (比如 1000, 2000, 3000 等) 中每个样本的中介效应,并能从中得到置信区间和标准误,如果中介效应的置信区间不包括零值,则可以认为中介效应统计显著。

2.3.2 基于蒙特卡洛模拟的检验方法

尽管自助法比 Sobel 检验更优,但它的估计过程比较耗时,对研究者来说实用性欠佳。而对自助法的一个比较好的替代方法是蒙特卡罗法(Monte Carlo approach) (Jose, 2013)。这个方法根据系数 a 和 b 以及它们各自的标准误,生成 a 和 b 的随机正态变量,以产生 值的分布 (Kenny, 2016)。然后和自助法一样,可以计算出标准误和相应的置信区间。

3. medsem 命令介绍

medsem 在估计完中介模型后使用,即在使用 Stata 对于结构方程模型的内嵌命令 sem 后进行使用。

medsem 的安装方法如下:

ssc install medsem, replace

其语法结构为:

medsem, indep(varname) med(varname) dep(varname)
[mcreps(number) stand zlc rit rid]

其中各部分含义如下:

可选项:

4. 使用 medsem 进行中介效应分析的示例

使用 Stata 系统的自带数据,假设 age (X) 和 wage (Y) 的中介变量为 ttl_exp (M)。

sysuse nlsw88, clear
describe age ttl_exp wage

storage display value
variable name type format label variable label
--------------------------------------------------------------------
age byte %8.0g age in current year
ttl_exp float %9.0g total work experience
wage float %9.0g hourly wage

在使用 medsem 命令前,我们需要使用 sem 命令估计整个中介模型,进而观察路径系数:。sem 的输出估计结果如下:

. sem (ttl_exp <- age) ///
(wage <- ttl_exp age)

-------------------------------------------------------------------------------
| OIM
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
Structural |
ttl_exp |
age | .1872773 .0315437 5.94 0.000 .1254528 .2491018
_cons | 5.20248 1.238799 4.20 0.000 2.774477 7.630482
------------+----------------------------------------------------------------
wage |
ttl_exp | .3423311 .0255289 13.41 0.000 .2922953 .3923669
age | -.1321344 .038462 -3.44 0.001 -.2075185 -.0567504
_cons | 8.649318 1.504655 5.75 0.000 5.700248 11.59839
--------------+----------------------------------------------------------------
var(e.ttl_exp)| 20.91629 .6241583 19.72805 22.1761
var(e.wage)| 30.61679 .9136289 28.87747 32.46088
-------------------------------------------------------------------------------

接下来,使用 medsem 命令检验是否存在中介效应:

. medsem, indep(age) med(ttl_exp) dep(wage)

Significance testing of indirect effect (unstandardised)
+-----------------------------------------------------------------+
Estimates | Delta | Sobel | Monte Carlo
|-----------------------------------------------------------------|
Indirect effect | 0.064 | 0.064 | 0.064
Std. Err. | 0.012 | 0.012 | 0.012
z-value | 5.429 | 5.429 | 5.491
p-value | 0.000 | 0.000 | 0.000
Conf. Interval | 0.041 , 0.087 | 0.041 , 0.087 | 0.042 , 0.08
|-----------------------------------------------------------------|

Baron and Kenny approach to testing mediation
STEP 1 - ttl_exp:age (X -> M) with B=0.187 and p=0.000
STEP 2 - wage:ttl_exp (M -> Y) with B=0.342 and p=0.000
STEP 3 - wage:age (X -> Y) with B=-0.132 and p=0.001
As STEP 1, STEP 2 and STEP 3 as well as the Sobel's test above
are significant the mediation is partial!
+-----------------------------------------------------------------+
Note: to read more about this package help medsem

我们也可以附加选项,以便输出更检验多结果:

. medsem, indep(age) med(ttl_exp) dep(wage)  ///
mcreps(5000) stand zlc rit rid

Significance testing of indirect effect (standardised)
+-----------------------------------------------------------------+
Estimates | Delta | Sobel | Monte Carlo
|-----------------------------------------------------------------|
Indirect effect | 0.034 | 0.034 | 0.034
Std. Err. | 0.006 | 0.006 | 0.006
z-value | 5.472 | 5.516 | 5.496
p-value | 0.000 | 0.000 | 0.000
Conf. Interval | 0.022 , 0.046 | 0.022 , 0.046 | 0.022 , 0.047
|-----------------------------------------------------------------|

Baron and Kenny approach to testing mediation
STEP 1 - ttl_exp:age (X -> M) with B=0.124 and p=0.000
STEP 2 - wage:ttl_exp (M -> Y) with B=0.274 and p=0.000
STEP 3 - wage:age (X -> Y) with B=-0.070 and p=0.001
As STEP 1, STEP 2 and STEP 3 as well as the Sobel's test above
are significant the mediation is partial!

Zhao, Lynch & Chen's approach to testing mediation
STEP 1 - wage:age (X -> Y) with B=-0.070 and p=0.001
As the Monte Carlo test above is significant, STEP 1 is
significant and their coefficients point in opposite
direction, you have competitive mediation (partial mediation)!

RIT = (Indirect effect / Total effect)
(0.034 / 0.036) = 0.942
Meaning that about 94 % of the effect of age
on wage is mediated by ttl_exp!

RID = (Indirect effect / Direct effect)
(0.034 / 0.070) = 0.485
That is, the mediated effect is about 0.5 times as
large as the direct effect of age on wage!

此时输出的系数是标准化系数sem结构方程模型是什么,同时输出了 RIT 和 RID 值。

5. 结语

通过 SEM 进行中介效应分析可以对所有模型参数同时进行估计,具有更小的标准误,medsem 是进行 SEM 模型估计再进行使用的后估计命令,输入 ssc install medsem, replace 命令即可安装,使用较为方便。对更复杂的结构方程模型的中介效应估计感兴趣的学者可以进一步阅读下方的参考资料,点开文末阅读原文即可打开链接。

6. 参考资料

限 时 特 惠:本站每日持续更新海量各大内部创业教程,一年会员只需98元,会员全站资源免费获取点击查看会员权益
站 长 微 信:ryenlii666

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。