use "C:\Users\xxxxx\Desktop\sgmediation2\cda_ah4.dta", clear
drop if missing(health, edyrs, income, race, woman, age)
*基本用法
sgmediation2 health, iv(edyrs) mv(income)
*添加控制变量
sgmediation2 health, iv(edyrs) mv(income) cv(i.race i.woman age)
*添加已通过 `svyset` 命令设置的调查权重
sgmediation2 health, iv(edyrs) mv(income) cv(i.race i.woman age) prefix(svy:)
*获取针对 occcat 进行聚类时的稳健聚类方差估计值
sgmediation2 health, iv(edyrs) mv(income) cv(i.race i.woman age) vce(cluster occcat)
*使用自助法来获取标准误差和置信区间
bootstrap r(ind_eff) r(dir_eff) r(tot_eff), reps(1000): sgmediation2 health, iv(edyrs) mv(income) cv(i.race i.woman age)
*基于自助抽样获得偏差校正后的百分位数置信区间
estat bootstrap, bc percentile


雷达卡




京公网安备 11010802022788号







