Hi,
I am trying to do run the following model saved in "C:/bugs/sus.bug"
model {
for (i in 1:n){
y[i] ~ dpois(lamdba[i])
log(lambda[i]) <- mu+bmale[male[i]]+bschn[schn[i]]+epsilon[i] #
epsilon[i] ~ dnorm(0,tau.epsilon)
}
mu ~ dnorm(0,.0001)
bmale ~ dnorm(0,.0001)
tau.epsilon <- pow(sigma.epsilon, -2)
sigma.epsilon ~ dunif(0,100)
for (j in 1:n.schn){
bschn[j] ~ dnorm(0,tau.schn)
}
tau.schn <- pow(sigma.schn, -2)
sigma.schn ~ dunif(0,100)
}
I am running the following syntax:
enroll.wide.m <- na.omit(enroll.wide)
n <- nrow(enroll.wide.m)
y <- enroll.wide.m$sus.5
sch <- as.vector(enroll.wide.m$schno.5)
uniq <- unique(sch)
n.schn <- length(uniq)
male <- enroll.wide.m$male
schn <- enroll.wide.m$schno.5
data <- list
("n","n.schn","y","male","schn")
inits <- function() {list (bschn=rnorm(n.schn), mu=rnorm(1,0,100),
bmale=rnorm(1,0,100),
sigma.epsilon=runif(1,0,100),sigma.schn=runif(1,0,100))}
parameters <-
c("bschn","mu","bmale","sigma.epsilon","sigma.schn")
sus.sim <-
bugs(data,inits,parameters,"C:/bugs/susc.bug",n.chains=3,n.iter=10,debug=TRUE)
And get the following error:
display(log)
check(C:\DOCUME~1\CHRIST~1\LOCALS~1\Temp\Rtmpyg7eDj/susc.bug.txt)
empty slot not allowed in variable name
data(C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/data.txt)
command #Bugs:data cannot be executed (is greyed out)
compile(3)
inits(1,C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/inits1.txt)
command #Bugs:inits cannot be executed (is greyed out)
inits(2,C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/inits2.txt)
command #Bugs:inits cannot be executed (is greyed out)
inits(3,C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/inits3.txt)
command #Bugs:inits cannot be executed (is greyed out)
gen.inits()
command #Bugs:gen.inits cannot be executed (is greyed out)
thin.updater(1)
update(5)
command #Bugs:update cannot be executed (is greyed out)
set(bschn)
command #Bugs:set cannot be executed (is greyed out)
set(mu)
command #Bugs:set cannot be executed (is greyed out)
set(bmale)
command #Bugs:set cannot be executed (is greyed out)
set(sigma.epsilon)
command #Bugs:set cannot be executed (is greyed out)
set(sigma.schn)
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(5)
command #Bugs:update cannot be executed (is greyed out)
coda(*,C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/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:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/history.odc)
command #Bugs:history cannot be executed (is greyed out)
save(C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/log.odc)
save(C:/DOCUME~1/CHRIST~1/LOCALS~1/Temp/Rtmpyg7eDj/log.txt)
Any help would be greatly appreciate. Also please cc me as I am digest
subscriber.
Chris