reg y d1 c.d1#c.d1 v1 c.d1#c.v1 c.v1#c.d1#c.d1
我使用了笨方法
reg y c.v1##c.d1##c.d1
foreach v of var d1 v1 {
sum `v' if e(sample)
local low_`v' = r(mean)-r(sd)
local high_`v' = r(mean)+r(sd)
}
#delimit
twoway ( function y = _b[d1 ]*x + _b[c.d1 #c.d1]*x^2 + _b[v1*`low_v1' + _b[c.d1#c.v1]*x*`low_v1' + _b[c.d1#c.d1#c.v1]*x^2*`low_v1', range(0 1) )
( function y =_b[d1]*x + _b[c.d1#c.d1]*x^2 + _b[v1]*`high_v1' + _b[c.d1#c.v1]*x*`high_v1' + _b[c.d1#c.d1#c.v1]*x^2*`high_v1', range(0 1) lp(dash) )
,
scheme(lean1)
ytitle("v1") xtitle("d1") title(" ")
xlabel(0 " " `low_d1' "low LKD" `high_d1' "High LKD" 1 " ")
legend(off)
;
#delimit cr
一定要一起运行才能成功。
|