各位站友,我在学习stata11的Worked example of glst command时遇到一下问题:
不知道是因为什么原因,在“capture estimates save mvmeta, replace”这句命令中,这个.ster文件始终无法保存,以至于在"estimates use mvmeta" 命令里出现“file mvmeta.ster not found r(601)”的问题.
请问这是哪里出问题了,怎么解决啊?
谢谢了!
一下附上这个.do文件里面的命令:
version 11
use http://nicolaorsini.altervista.org/data/bmi_rc, clear
// Center each study to the baseline reference dose (first row within each study)
// NB: This is important to avoid bias estimates
// because glst is assuming the fitted line is going through the origin (lnRR=0,dose=0)
bysort id: gen bmic = bmi - bmi[1]
// create spline transformations for the centered exposure
mkspline bmics = bmic, nk(3) cubic
// create spline transformations for the original exposure to be used for predictions
mkspline bmis = bmi, nk(3) cubic
// First stage - Study specific estimates using splines
mvmeta_make glst logor bmics1 bmics2, cov(n case) se(selogor) pfirst(id studyt) saving(ssest_spline) replace by(id) names(b V)
// Second stage - Pool study specific estimates using random-effects
preserve
use ssest_spline, clear
mvmeta b V , mm i2
capture estimates save mvmeta, replace
restore
// Obtain and plot the dose-response relationship back on the original scale
estimates use mvmeta
// Get values of the splines at the chosen reference value (min)
su bmis1 bmis2 if bmi == float(19.3)
predictnl logor_sp = _b[bbmics1]*(bmis1-19.3) + _b[bbmics2]*(bmis2-0) , ci(los his)
gen ors = exp(logor_sp)
gen lbs = exp(los)
gen ubs = exp(his)
// Compare with a linear trend using a two-stage random-effect
glst logor bmic, cov(n case) se(selogor) pfirst(id studyt) ts(r)
// Obtain and plot the dose-response relationship back on the original scale
predictnl logor_l = _b[bmic]*(bmi-19.3)
gen orl = exp(logor_l)
// Overlay predictions from spline and linear models
twoway ///
(line orl bmi, sort lc(black) lp(-) ) ///
(line ors lbs ubs bmi, sort ///
lw(thick thick thick) lc(black black black) ///
lp(l longdash longdash)) , ///
yscale(log) ///
ytitle("Relative Risk") xtitle("Body Mass Index") ///
scheme(s1mono) ///
xlabel(19(1)35) xmtick(19(.5)35) ///
ymtick(1(.5)8) ylabel(1 2 4 8 , format(%3.2fc) angle(horiz)) ///
legend(label(1 "Linear Model") label(2 "Spline Model") ///
order(1 2) ring(0) pos(11) col(1) ) ///
plotregion(style(none))


雷达卡




京公网安备 11010802022788号







