Skip to content
Prev 5260 / 20628 Next

glmer question family=Gamma(link="identity") error. Re: lmer formula syntax?

Colin Wahl <biowahl at ...> writes:
My bottom line on this: 
if you can get the denominator information (how many total inverts
were sampled in each place?) then you can do this as a binomial GLMM.
Otherwise I would just go for it as a regular LMM; the q-q plots of
residuals based on this approach don't look too bad. Binomial would
probably be slightly better: transforming the response variable won't
work because you have a big pile of zeros in your data.

  Is there a reason you are interested in the within-stream,
within-zone variance?  If not, I would be tempted to aggregate
these data to make life simpler (and the residuals a bit more
normal, although it doesn't quite reduce to a balanced split-plot
design)

x <- read.table("ept.dat",header=TRUE)
ax <- aggregate(ept~rip+wsh+stream,data=x,FUN=mean)

library(ggplot2)
ggplot(x,aes(x=rip,y=ept,colour=rip))+
  facet_grid(.~wsh)+stat_sum(aes(size=..n..))+
  geom_line(data=ax,aes(group=stream),colour="gray")


m1 <- lmer(ept~rip+wsh+(1|stream),data=ax)
qqnorm(residuals(m1))
qqline(residuals(m1),col="gray")

m2 <- lmer(ept~rip+wsh+(1|stream),data=x)
qqnorm(residuals(m2),pch=as.numeric(x$stream))
qqline(residuals(m1),col="gray")


Murtaugh, Paul A. 2007. Simplicity and Complexity in Ecological Data Analysis.
Ecology 88, no. 1: 56-62.
http://www.esajournals.org/doi/abs/10.1890/0012-9658%282007%2988%5B56%3ASACIED%5D2.0.CO%3B2.