全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
24809 16
2013-07-04
各位站友,我在学习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))

二维码

扫码加我 拉你入群

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

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

全部回复
2013-7-4 12:32:54
经测试真是如楼主所说。
Stata11会
測試Stata11_2013_7_4.JPG

然而若用Stata12,则
測試2013_7_4.JPG

所以,楼主还是改用Stata12吧!
二维码

扫码加我 拉你入群

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

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

2013-7-4 17:08:00
h3327156 发表于 2013-7-4 12:32
经测试真是如楼主所说。
Stata11会
谢谢h3327156站友!
但是我用论坛里提供的stata12也是出现那个错误提示
你能把你用的stata12的下载地址给我吗?
或者发一份到我的邮箱drchenfei@163.com,谢谢了!
二维码

扫码加我 拉你入群

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

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

2013-7-4 17:49:06
zhang_yeah 发表于 2013-7-4 17:08
谢谢h3327156站友!
但是我用论坛里提供的stata12也是出现那个错误提示
你能把你用的stata12的下载地址 ...
我很穷地,所以也是使用论坛上的 Stata12,
我之前曾出问题重灌,使用下载的Stata12是在
https://bbs.pinggu.org/thread-2197237-1-1.html

祝 顺利解决阿!

不过记得喔,灌了之后,一开始还是不能执行,但它会提示有那些外部命令须要重下载。
二维码

扫码加我 拉你入群

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

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

2013-7-4 18:52:20
h3327156 发表于 2013-7-4 17:49
我很穷地,所以也是使用论坛上的 Stata12,
我之前曾出问题重灌,使用下载的Stata12是在
http://bbs.pi ...
真的太感谢了!!!
我重新安装下,有问题再请教你
二维码

扫码加我 拉你入群

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

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

2013-7-5 12:07:45
h3327156 发表于 2013-7-4 17:49
我很穷地,所以也是使用论坛上的 Stata12,
我之前曾出问题重灌,使用下载的Stata12是在
http://bbs.pi ...
我下载https://bbs.pinggu.org/thread-2197237-1-1.html里的STATA12,按照帖子里的说明安装,并下载外部命令后,还是不能执行。
不知道是我安装的路径有问题呢(c:\program file\stata12和d:\stata12这两个安装路径我都试过),还是因为我用的是win7系统而导致的问题。
你用的是win xp系统吧?你在重灌软件时,有什么需要特别注意的地方吗?

谢谢啦!
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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