全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
700 0
2021-10-24
在做简单斜率分析图的时候,使用了黄老师的代码,但是在sum `v' if e(sample)时出现了以下错误,sum命令已经安装好了,以前就经常用,不是没有安装的问题,求教,代码如下
regress z_D离职 c.z_薪资待遇##c.z_自主
est store r1
foreach v of varlist z_薪资待遇 z_自主 {
  sum `v' if e(sample)
  local low_`v' = r(mean)-r(sd)
  local high_`v' = r(mean)+r(sd)
}
margins, at(z_薪资待遇=(`low_z_薪资待遇' `high_z_薪资待遇') z_自主=(`low_z_自主' `high_z_自主'))
marginsplot, xlabel(13 " " `low_z_薪资待遇' "Low IV" `high_z_薪资待遇' "High IV" 30 " ") ///
   ytitle("z_D离职") ylabel(2000(1000)9000, angle(0) nogrid) ///
   legend(position(3) col(1) stack) title("") noci ///
   plot1opts(m(Oh) lp(dash)) plot2opts(m(square) lp(dot))







屏幕截图 2021-10-24 123515.jpg


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群