s**u 发帖数: 383 | 1 刚开始学WINBUG, 写了个小程序, model 问题, 但是load data 时说 expected
variable name. 请问哪里出错了. 谢谢.
model {
for (i in 1:9) {n[i] <- nwin1[i] + nwin2[i]
winn1[i] ~dbin(p[i],n[i])
logit(p[i]) <- d[dind1[i]]-d[dind2[i]]}
for ( i in 1:2) {d[i] ~ dnorm(0, 0.001)}
for ( i in 4:5) {d[i] ~ dnorm(0, 0.001)}
d[3] <-0
}
list (dind1 = c(1,1,1,1,2,2,2,3,4),
dind2 = c(2,3,4,5,3,4,5,5,5),
nwin1 = c(9,12,6,27,9,12,12,2,2),
nwin2 = c(10,2,3,2,5,3,3,0,4))
list(d =c(0, 0, NA,0,0)) | l*********s 发帖数: 5409 | 2 logit(p[i]) <- d[dind1[i]]-d[dind2[i]]}
you probably should put this into another loop; logit probably shall
not be entered on the left; and din2[i] shall not appear on the right. |
|