Skip to content
Prev 169678 / 398506 Next

glmmBUGS: logistic regression on proportional data

Installing the glmmBUGS package and a bit of experimentation produces  
this minor modification of your code that seems to run without error.  
It's back to you to see if the output is sensible.

library(glmmBUGS)
Newdat<-data.frame(Newtree=rep(1:3, each=20), Newsect=rep(c("a","b"),
each=10), Newdist=rep(1:5, 2),
                  y=rpois(60,2), tot=rep(c(14,12,10,8,6), 12))

yseed<-cbind(Newdat$y, Newdat$tot)

mod<-glmmBUGS(y/tot~Newsect + Newdist, effects="Newtree",
family="binomial", data=Newdat)

I am guessing that the interpreter was looking for a variable yseed  
within Newdat and not finding it. It, however, is able to "see" y and  
tot within Newdat. Also appears that using cbind(y, tot) on the LHS of  
hte formula will avoid the error you were getting.