全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2482 4
2015-04-13
我最近做二分类变量的网络meta分析 到最后一步总是WinBUGS报错,报错结果以及我的运行代码(附件是我的数据[[url=]netmeta.rar[/url]以及用的模型[url=]random effects model for binar ...[/url]如下,恳请知道的人解答一下,不胜感激。
display(log)
check(D:/rwork/random effects model for binary data.R.txt)
model is syntactically correct
data(D:/rwork/data.txt)
data loaded
compile(1)
made use of undefined node n
inits(1,D:/rwork/inits1.txt)
command #Bugs:inits cannot be executed (is greyed out)
gen.inits()
command #Bugs:gen.inits cannot be executed (is greyed out)
thin.updater(30)
update(334)
command #Bugs:update cannot be executed (is greyed out)
set(lor)
command #Bugs:set cannot be executed (is greyed out)
set(or)
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(1000)
command #Bugs:update cannot be executed (is greyed out)
coda(*,D:/rwork/coda)
command #Bugs:coda cannot be executed (is greyed out)
stats(*)
command #Bugs:stats cannot be executed (is greyed out)
dic.stats()

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



这是我的全部程序代码
library(boot)
library(coda)
library(lattice)
library(foreign)
library(R2WinBUGS)
bugsname <- file.path("D:/rwork","random effects model for binary data.R")
mymeta<-read.csv("C:/Users/wtw/Desktop/netmeta.csv")
mymeta
t<-array(,dim=c(69,3))
r<-array(,dim=c(69,3))
n<-array(,dim=c(69,3))
t[,1]<-mymeta$t..1.
r[,1]<-mymeta$r..1.
n[,1]<-mymeta$n..1.
t[,2]<-mymeta$t..2.
r[,2]<-mymeta$r..2.
n[,2]<-mymeta$n..2.
t[,3]<-mymeta$t..3.
r[,3]<-mymeta$r..3.
n[,3]<-mymeta$n..3.
na<-mymeta$na..
ns<-69
nt<-10
data<-list("t","r","n","na","ns","nt")
data
inits<-function()
{
list(d=c(NA,0,0,0,0,0,0,0,0,0,0,0,0,0),sd=1,
mu=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0))
}
parameters <- c("lor", "or")
metaresult<-bugs(data,inits,parameters,bugsname,n.chains=1,n.iter=40000,
n.burnin=10000,bugs.directory="D:/Program Files/WinBUGS14/",working.directory="D:/rwork",debug=T)

附件列表

netmeta.rar

大小:575 Bytes

 马上下载

这是错的 不知道怎么删除

本附件包括:

  • netmeta.csv

random effects model for binary data.rar

大小:1.6 KB

 马上下载

模型

本附件包括:

  • random effects model for binary data.R

netmeta.rar

大小:576 Bytes

 马上下载

我使用的数据

本附件包括:

  • netmeta.csv

二维码

扫码加我 拉你入群

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

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

全部回复
2015-4-13 23:05:28
请@epoh老师指导一下
二维码

扫码加我 拉你入群

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

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

2015-4-14 09:08:50
@epoh老师  我自己发现了我的数据录入有问题 ,但是修改之后又出现undefined real result 这个错误
二维码

扫码加我 拉你入群

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

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

2015-4-14 17:56:40
已解决
二维码

扫码加我 拉你入群

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

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

2015-6-8 14:24:40
你给的代码看起来没有啥问题啊?你的问题是啥原因?、
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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