Re: [R] Nested design

From: Spencer Graves <>
Date: Mon 22 May 2006 - 01:34:42 EST

<see inline>

Giovanni Bacaro wrote:
> Dear list members,
> I'd like to perform a glm analysis with a hierarchically nested design. In

> particular,
> I have one fixed factor ("Land Use Classes") with three levels and a random
> factor ("quadrat") nested within Land Use Classes with different levels per
> classes (class artificial = 1 quadrat; class crops = 67 quadrats; and class
> seminatural = 30 quadrats).
> I have four replicates per each quadrats (response variable = species
> richness per plot)
> Here some question about:
> 1) could I analize these data using the class "artificial" (i.e. I have only
> 1 level)?

SG: I don't know for sure, but I don't think it would be a problem. I wouldn't be afraid to try.
> 2) using R I'd like perfor a glm analysis considering my response variable
> (count of species) with a Poisson distribution. How can I develop my model
> considering the nested nature of my design? I'm sorry but I don't know the
> right package to use.
SG: There are several functions for "generalized linear mixed models", but I think the best is 'lmer' with the 'lme4' and 'matrix' packages. For documentation, I recommend the "MlmSoftRev" vignette in the "mlmRev" package
plus the article by Doug Bates in a recent issue of "R News" on this subject. Vignettes are particularly powerful, because you get both an Adobe Acrobat *.PDF file and a companion script file that you can work through line by line. To see how to do this, I suggest you try something like RSiteSearch("vignette edit") [or RSiteSearch("vignette emacs") if you use (X)Emacs]. To find the suggested Bates article, try "" -> "Documentation: Newsletter", then download and search the table of contents.
> 3) for the Anova analysis I'd like use a post-hoc comparison between
> pairwise classes. What is the right procedure to do this? Is this analysis
> performed in R?

SG: Try RSiteSearch("post-hoc comparisons").
> Thanks
> Giovanni
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Mon May 22 01:43:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 22 May 2006 - 04:10:14 EST.

Mailing list information is available at Please read the posting guide before posting to the list.