6828 31

# [编程问题求助] 求救STATA做Bootstrap方法-需要用到两个回归方程的系数 [推广有奖]

• 2关注
• 2粉丝

22%

-

0

212 个

1 点

0 点

0 点

1156 点

93

0

113 小时

2010-10-30

2014-4-22

 本帖最后由 蓝色 于 2012-12-21 11:08 编辑 正在学习用STATA做Bootstrap的方法，，如果我想要通过Bootstrap得到一个统计值的BC置信区间，而这个统计值是通过两个回归方程得到的，请问应该如何做？ 比如：第一个回归： PM=a0+a1SL+a2SR          第二个回归：OC=b0+b1SR+b2PM+b3SL+b4SR*SL+b5SR*PM 我想要求a1*b5的BC置信区间，应该如何做？ 万分感谢！！！ .custom_tag{background:none; padding-left:0;} .custom_tag a{text-decoration:none; margin-right:7px;} .custom_tag a:hover{text-decoration:underline;} .custom_tag i{display: inline-block;width: 60px;} .bjxglj{ float: right; color: #e4751d; font-size: 14px;} .bjxglj:hover{ text-decoration: underline;} .top_related_thread { background: #fff;} .t_f a { text-decoration: initial;} .t_f a:hover{ text-decoration:underline; } .top_related_thread ul{max-height: 125px;overflow: hidden;}

### 回帖推荐

sophiafinn 发表于9楼

in your case capture drop program bootaaa program bootaaa, rclass sureg ( PM SL SR) (OC SR PM SL SR*SL SR*PM) if' in' return scalar aaa = _b[SL]*[OC]_b[SR*PM] end bootstrap r(aaa) , bca reps(5000) nodots: bootaaa

Tomorrow is another day!!

 请各位高手踊跃帮忙啊~~
Tomorrow is another day!!

 .....
Tomorrow is another day!!

 等待回答。。。。
Tomorrow is another day!!

 帮忙啊～～～
Tomorrow is another day!!

 求救！！
Tomorrow is another day!!

sophiafinn 发表于 2013-2-7 08:19:11 |显示全部楼层
 I guess similar to this one http://www.ats.ucla.edu/stat/stata/faq/mulmediation.htm

sophiafinn 发表于 2013-2-7 08:20:44 |显示全部楼层
 capture drop program bootmm program bootmm, rclass   syntax [if] [in]   sureg (read math)(write math)(science read write math) if' in'   return scalar indread  = [read]_b[math]*[science]_b[read]   return scalar indwrite = [write]_b[math]*[science]_b[write]   return scalar indtotal = [read]_b[math]*[science]_b[read]+ ///                            [write]_b[math]*[science]_b[write] end bootstrap r(indread) r(indwrite) r(indtotal), bca reps(5000) nodots: bootmm

sophiafinn 发表于 2013-2-7 08:25:12 |显示全部楼层
 in your case capture drop program bootaaa program bootaaa, rclass sureg ( PM SL SR) (OC SR PM SL SR*SL SR*PM) if' in' return scalar aaa  = [PM]_b[SL]*[OC]_b[SR*PM] end bootstrap r(aaa) , bca reps(5000) nodots: bootaaa

 sophiafinn 发表于 2013-2-7 08:25 in your case capture drop program bootaaa十分感谢！！我自己做了一下，应该就是这个样子了。不过在sureg语句上面需要再加上syntax [if][in] 否则运行结果就会显示insufficient observations to compute jackknife standard errors no results will be saved。 再次感谢！！

Tomorrow is another day!!

 您需要登录后才可以回帖 登录 | 我要注册 回帖后跳转到最后一页