楼主: 王小6
33627 25

[回归分析求助] 中介效应sgmediation和bootstrap的结果怎么看? [推广有奖]

11
gloria8833 发表于 2019-5-30 20:42:28
王小6 发表于 2019-1-28 20:48
直接效应和间接效应的置信区间的上下限不包括0  表示有中介效应  符号应该是要保持一致的吧
请问如果bs1的置信区间包含0 而bs2的置信区间不包含0 该怎么解读呢?

12
yanglingyang 在职认证  发表于 2019-7-20 09:46:40
郭2423088188 发表于 2019-4-22 19:33
您好,请问我的面板数据总出现'r(ind_eff)' evaluated to missing in full sample
r(322);
是什么原因呢 ...
您好,您上述问题解决了吗?我也遇到了同样的问题,恳求您的回复。

13
郭2423088188 发表于 2019-7-23 09:13:29
没有解决,我最后用AMOS做了

14
晶晶哈哈 学生认证  发表于 2019-8-23 18:31:00
中介效应是16.44%,具体可以参考http://www.360doc.com/content/16/0229/09/77317_538191650.shtml   可以给我发下你的命令给我吗,我的sgmediation有点问题

15
晶晶哈哈 学生认证  发表于 2019-8-23 18:32:52
郭2423088188 发表于 2019-4-22 19:33
您好,请问我的面板数据总出现'r(ind_eff)' evaluated to missing in full sample
r(322);
是什么原因呢 ...
应该是我们的ado文件的命令包有问题。我打开看了一下,我们的sgmediation里面没有计算 ind_eff 这个单值

16
晶晶哈哈 学生认证  发表于 2019-8-23 18:36:59
yanglingyang 发表于 2019-7-20 09:46
您好,您上述问题解决了吗?我也遇到了同样的问题,恳求您的回复。
sgmediation 的ado文件包里没有计算ind_eff这个单值。如果要解决这个问题,可以自己在ado文件里改一下,计算这个单值
*! version 1.1.1 -- 5/17/06 -- pbe
*! verion 1.0 -- 2/28/05 -- pbe
program define sgmediation
/* sobel-goodman mediation tests */
version 8.0
syntax varlist(max=1) [if/] [in], iv(varlist numeric max=1) ///
   mv(varlist numeric max=1) [ cv(varlist numeric) BOOTstrap reps(integer 200) level(integer 95)]
marksample touse
markout `touse' `varlist' `mv' `iv' `cv'
tempname coef emat

display
display as text "Model with dv regressed on iv"
regress `varlist' `iv' `cv' if `touse'
local ccoef=_b[`iv']

display
display "Model with mediator regressed on iv"
regress `mv' `iv' `cv' if `touse'

local acoef=_b[`iv']
local avar=_se[`iv']^2

display
display "Model with dv regressed on mediator and iv"
regress `varlist' `mv' `iv' `cv' if `touse'

local bcoef=_b[`mv']
local bvar=_se[`mv']^2

local sobel =(`acoef'*`bcoef')
local serr=sqrt(`bcoef'^2*`avar' + `acoef'^2*`bvar')
local stest=`sobel'/`serr'
local g1err=sqrt(`bcoef'^2*`avar' + `acoef'^2*`bvar' + `avar'*`bvar')
local good1=`sobel'/`g1err'
local g2err=sqrt(`bcoef'^2*`avar' + `acoef'^2*`bvar' - `avar'*`bvar')
local good2=`sobel'/`g2err'
local toteff = `sobel'/((`acoef'*`bcoef')+(`ccoef'-(`acoef'*`bcoef')))
local ratio = `sobel'/((`ccoef'-(`acoef'*`bcoef')))

display
display "Sobel-Goodman Mediation Tests"
display
display "             Coef         Std Err     Z           P>|Z|"
display as txt "Sobel       " as res `sobel' _skip(4) `serr'  %8.4g ///
`stest', _skip(5) 2*(1-norm(abs(`stest')))
display as txt "Goodman-1   " as res `sobel' _skip(4) `g1err' %8.4g ///
`good1', _skip(5) 2*(1-norm(abs(`good1')))
display as txt "Goodman-2   " as res `sobel' _skip(4) `g2err' %8.4g ///
`good2', _skip(5) 2*(1-norm(abs(`good2')))
display
display as txt "Pecent of total effect that is mediated: ", as res ///
%5.2f 100*`toteff',"%"
display as txt "Ratio of indirect to direct effect:     ", as res %8.4f `ratio'

if "`bootstrap'"~="" {
  display
  display as txt "Percentile and Bias-corrected bootstrap results for Sobel: `reps' replications"
  display

  quietly bootstrap coef=r(sobel), reps(`reps') level(`level'): sgboot `varlist' , mv(`mv') iv(`iv') cv(`cv' )
  estat bootstrap, bc percentile noheader
  }

end




17
jingguan145 学生认证  发表于 2019-10-17 00:08:27
郭2423088188 发表于 2019-4-22 19:33
您好,请问我的面板数据总出现'r(ind_eff)' evaluated to missing in full sample
r(322);
是什么原因呢 ...
我也出现了这种情况,重新安装一下sgmediation命令包就可以了。你的命令包应该有问题

18
jingmoruyan 发表于 2019-10-29 10:32:19
谢谢你呀,解决了困扰我好久的问题

19
牛慧君 发表于 2020-2-15 17:01:00
郭2423088188 发表于 2019-4-22 19:33
您好,请问我的面板数据总出现'r(ind_eff)' evaluated to missing in full sample
r(322);
是什么原因呢 ...
https://bbs.pinggu.org/forum.php?mod=viewthread&tid=7280176&page=1#pid61602803

可以看看这个帖子

20
辉辉灰 发表于 2020-3-6 16:18:41
郭2423088188 发表于 2019-4-22 19:33
您好,请问我的面板数据总出现'r(ind_eff)' evaluated to missing in full sample
r(322);
是什么原因呢 ...
stata 中介效应 bootstrap时出现r(ind_eff)找不到 - Stata专版 - 经管之家(原人大经济论坛)  https://bbs.pinggu.org/thread-7280176-1-1.html

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-18 08:19