全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
6026 8
2015-03-17
大家好,这两天正在尝试用R语言做生存分析,其中需要贝叶斯统计;主要模型是来自文献资料,但是运行过程中反复出现问题,希望大神们帮忙解答,谢谢!
我用了两种方法,载入Library(BRugs),然后运行如下代码:
复制代码
以上,前面model check通过,load data通过,model compile通过,但是问题在于,每次到了modelGenInits() 这一步,就会提示:
error.png
Rstudio提示:
Error in handleRes(res) : NA
In addition: Warning message:
running command '"d:/Program Files/R/R-3.1.3patched/library/BRugs/exec/BugsHelper.exe" "C:/Users/TONGZ~1/AppData/Local/Temp/RtmpwPtl0g" "C:/Users/TONGZ~1/AppData/Local/Temp/RtmpwPtl0g/trash" "file18382a0663b.bug" "C:/Users/TONGZ~1/AppData/Local/Temp/RtmpwPtl0g/cmds.txt" "1"' had status 144


实在不明白怎么回事,找到了 Bugshelper.exe 双击打开提示
error2.png
后来我在Openbugs 中找到libOpenBUGS.dll(重新安装了几次,该文件应当没有损坏。。),放到Bugshelper.exe旁边,又出现了第一张图的提示……
反复如此,用R和Rstudio都是一样的……

之后,我只好放弃Openbugs,改用R2WinBUGS
模型仍然是以上模型,读入的数据也是以上数据,最后运行bugs:
bugs.sim<-bugs(data,inits=NULL,parameters,noyear,n.chains=3,n.iter=40000,n.burnin=1000,bugs.directory="D:/winbugs14/WinBUGS14/",working.directory="c:/Bugs",debug=TRUE)

log信息如下:
display(log)
check(c:/Bugs/noyear.bug.txt)
model is syntactically correct
data(c:/Bugs/data.txt)
undefined variable
compile(3)
gen.inits()
command #Bugs:gen.inits cannot be executed (is greyed out)
thin.updater(117)
update(9)
command #Bugs:update cannot be executed (is greyed out)
set(beta)
command #Bugs:set cannot be executed (is greyed out)
set(p1)
command #Bugs:set cannot be executed (is greyed out)
set(p2)
command #Bugs:set cannot be executed (is greyed out)
set(p3)
command #Bugs:set cannot be executed (is greyed out)
set(deviance)
command #Bugs:set cannot be executed (is greyed out)
dic.set()
command #Bugs:dic.set cannot be executed (is greyed out)
update(334)
command #Bugs:update cannot be executed (is greyed out)
coda(*,c:/Bugs/coda)
command #Bugs:coda cannot be executed (is greyed out)
stats(*)
command #Bugs:stats cannot be executed (is greyed out)
dic.stats()

DIC
history(*,c:/Bugs/history.odc)
command #Bugs:history cannot be executed (is greyed out)
save(c:/Bugs/log.odc)
save(c:/Bugs/log.txt)


看这个意思好像是有未定义的变量。。?可是之前在BRugs中应该已经通过了啊。。
总是。。两种办法都卡住了。。。希望高手们看一下帮帮忙撒~~
十分感谢!!!!!

二维码

扫码加我 拉你入群

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

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

全部回复
2015-3-17 19:40:15
找同学的机器跑一下程序
二维码

扫码加我 拉你入群

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

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

2015-3-19 23:09:06
nuomin 发表于 2015-3-17 19:40
找同学的机器跑一下程序
试过了。。。仍然这样。。。
二维码

扫码加我 拉你入群

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

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

2016-3-18 10:01:30
请问您的问题解决了嘛?我也遇到了类似的问题:error:handleRes(res) : NA
在写论文,急求!看到请回复一下,谢谢!
二维码

扫码加我 拉你入群

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

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

2016-4-7 10:48:22
leo4526 发表于 2016-3-18 10:01
请问您的问题解决了嘛?我也遇到了类似的问题:error:handleRes(res) : NA
在写论文,急求!看到请回复一 ...
用单独的OPENBUGS 软件跑,不要放到R里跑
二维码

扫码加我 拉你入群

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

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

2016-4-9 17:24:24
空sutra 发表于 2016-4-7 10:48
用单独的OPENBUGS 软件跑,不要放到R里跑
请问前辈是什么原因出现的这个问题?之前我做过用R跑OpenBUGS程序,最近还是一模一样的程序,就出现了这个问题。而且当时记得分别用R里做OpenBUGS和直接在OpenBUGS里做两种方法出来的结果有很大的差别,这是为什么呀?(伤心脸)
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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