看到这个帖子是做多个中介变量分析的,但是他用的代码是sureg。https://stats.idre.ucla.edu/stata/faq/how-can-i-analyze-multiple-mediators-in-stata/
所以做中介检验时是应该用sureg还是reg啊。一直认为是直接reg两个方程,将系数乘起来的,为什么要sureg呢?
但是不用sureg搞了半天又没办法得到乘积项,怎么得到乘积项的置信区间?代码如下:
capture program drop bootmm
program bootmm, rclass
syntax [if] [in]
reg (wtopics r1 l1namount l1nsimp lagrank yrestab l1namou1 i.time) `if' `in'
return scalar m1x1 = _b[l1namount]
syntax [if] [in]
reg (reach r3 l1namount l1nsimp wtopics posperau lagrank yrestab l1namou1 i.time) `if' `in'
return scalar y1m1 = _b[wtopics]
end
bootstrap r(m1x1) r(y1m1) , bca reps(5): bootmm
estat boot, percentile bc bca