[R-sig-ME] multilevel nested data in lmer models

Douglas Bates bates at stat.wisc.edu
Thu Feb 15 23:32:32 CET 2007

On 2/15/07, Hallstrom, Wayne (Calgary)
<Wayne.Hallstrom at worleyparsons.com> wrote:
> I have what should be a simple question about structure of the formula
> for an lmer model. However, I can find no detailed description of how to
> write multilevel nested formulas for lmer though so I need some advice.
> Count data were collected at 10 subsample locations nested within each
> of 7 general locations over a 20 year period of repeated measures. At
> each of the 7 general locations there was a treatment applied partway
> through the 20 year period to 1/2 of the subsample locations.
> I thought running the lmer routine with the following general formula
> setup would account for the fixed effects of the treatment and the
> random effects of the nesting structure. A Quasipoisson distribution was
> used to account for over/underdispersed data.
> model1 <- lmer(count ~ a + (1 | b / c), dataset)
> This model returns an error message though - "too many groups, only the
> first is used".  I thought this formula should account for the grouped
> and nested data structure. I have used this model structure with a
> different dataset and a similar lmer model and it worked fine, nesting
> the one explanatory variable within the other in the proper arrangement
> and producing reasonable results. This time it does not work. Is there a
> different way the formula should be set up?

Could you show us the structure of the data set (use


and a transcript of your attempt to fit the model?  The reason I ask
is because I don't think that error message occurs in the lme4
package.  I just did a quick check on both the R and the C sources and
I can't find it.

Also please include the output of


in your message so we know what versions of various packages you are using.

> Someone with more background in this method must have had a similar
> problem before while using this lmer routine, so hopefully another
> perosn on the list can describe/advise how to deal with this kind of
> nested data and what may be the problem here...
> Thank you,
> Wayne Hallstrom
> "This email is confidential.  If you are not the intended recipient, you must not disclose  or  use the  information  contained in it.  If you have received this email in error,  please notify us immediately by return email and delete the email and any attachments. Any personal views or opinions expressed by the writer may not necessarily reflect the views or opinions of any company in the WorleyParsons Group of Companies."
>         [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

More information about the R-sig-mixed-models mailing list