我最近做二分类变量的网络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)
                                        
                                    
附件列表