[R] Syntax for random effect in glmmPQL

Mikael Niva mikael.niva at ebc.uu.se
Mon May 19 10:30:33 CEST 2003

Dear R-listers

I wonder if someone can help me with the syntax for the random effect in
glmmPQL()? I have a data set with a response variable "y" (counts), two
dependent variables: "treat" (4 levels) and "site" (2 levels). The
latter, I want to use as a random variable. How do I specify this in the

Is it like this: glmmPQL(y~treat,random=~1|site,family=poisson,
data=mydata)? What does the ~1 do?

Thanks in advance, Mikael Niva

Mikael Niva
Avd. för Växtekologi, Dept. of Plant Ecology 
Uppsala Universitet

More information about the R-help mailing list