采用连老师在论坛上发表的方法,结果可以得出来,但不明白如何看结果?以及结果如何导出到Word中,望高人指点!
命令:
- use "https://stats.idre.ucla.edu/stat/data/hsb2", clear
- rename science y // 被解释变量
- rename math x // 解释变量
- rename read m // 中介变量
- rename write w // 调节变量1
- rename socst z // 调节变量2
- summarize w
- global m=r(mean)
- global s=r(sd)
- generate wx=w*x /* moderator 1 by iv interaction */
- sem (m <- x w wx)(y <- m x w wx) // SEM 模型
- nlcom (_b[m:x]+($m-$s)*_b[m:wx])*_b[y:m] /* mean - 1 sd */
- nlcom (_b[m:x]+($m)*_b[m:wx])*_b[y:m] /* mean */
- nlcom (_b[m:x]+($m+$s)*_b[m:wx])*_b[y:m] /* mean + 1 sd */
- capture program drop bootm2
- program bootm2, rclass
- sem (m <- x w wx)(y <- m x w wx)
- return scalar cielw = (_b[m:x]+($m-$s)*_b[m:wx])*_b[y:m]
- return scalar ciemn = (_b[m:x]+($m)*_b[m:wx])*_b[y:m]
- return scalar ciehi = (_b[m:x]+($m+$s)*_b[m:wx])*_b[y:m]
- end
- bootstrap r(cielw) r(ciemn) r(ciehi), reps(500) nodots: bootm2
- estat boot, bc percentile


雷达卡




京公网安备 11010802022788号







