[R] using lme4 with three nested random effects

From: Benjamin Caldwell <btcaldwell_at_berkeley.edu>
Date: Thu, 28 Apr 2011 15:37:29 -0700

Hi all,
I'm trying to fit models for data with three levels of nested random effects: site/transect/plot. For example,

modelincrBS<-glmer(l.ru.ba.incr~shigo.av+pre.f.crwn.length+bark.thick.bh+Date+slope.pos.num+dens.T+dbh+leaf.area+can.pos.num+(1|site/transect/plot), data=rws30.UL, family=gaussian, na.action=na.omit)

but I get the following error:

Error: length(f1) == length(f2) is not TRUE In addition: Warning messages:
1: In plot:(transect:site) :
  numerical expression has 92 elements: only the first used 2: In plot:(transect:site) :
  numerical expression has 92 elements: only the first used

The formulation works for two nested effects (e.g. 1|site/transect)

I can get it to run in lme
modelincrBS<-lme(l.ru.ba.incr~shigo.av+pre.f.crwn.length+bark.thick.bh+Date+slope.pos.num+dens.T+dbh+leaf.area+can.pos.num, data=rws30.UL, random=(~1| site/transect/plot),na.action=na.omit)

but I can't specify a distribution family in that package.

Any help much appreciated.

Ben Caldwell


        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 28 Apr 2011 - 22:40:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 29 Apr 2011 - 10:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive