[R-sig-eco] nlme model specification

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Thu May 22 00:21:39 CEST 2008


Dear Matthew,

You specified year as a the grouping variable. In your case the tree id should be the grouping variable. So the most simple random effect is ~1|id, which is a random intercept for each tree. A more complex random effect would be ~ year|id, a random intercept and a random slope by year for each tree. You could make it even more complex by using ~factor(year)|id as a random effect.

HTH,

Thierry

PS Have a look in the archives of R-sig-mixed, the list dedicated to mixed models.

-----Oorspronkelijk bericht-----
Van: r-sig-ecology-bounces at r-project.org namens Landis, R Matthew
Verzonden: wo 21-5-2008 19:54
Aan: 'r-sig-ecology at r-project.org'
Onderwerp: [R-sig-eco] nlme model specification
 
Greetings R-eco folks,

I'm trying to analyze a dataset on tree growth rates to see which factors are important (and their relative importance too, if I can get that), and I'm having some trouble figuring out how to specify the model, despite having carefully read Pinheiro and Bates, the help files for nlme, Crawley's book on Statistics with S, MASS, and other books besides.

The dataset consists of ~ 300 trees measured annually for 10 years.  So, I have 9 pseudo-replicated intervals over which to assess growth (about 2700 rows in the dataset).  There are 5 different explanatory factors, which are a combination of continuous variables and categorical factors.  Some of these vary with time.  In the end, I would like to get both coefficient estimates and partial R2 (or some other way of ranking them) for each factor.  Unlike most time-series examples in the books, I am not interested in how growth varies with time, nor am I particular interested in interactions of explanatory factors with time.

Based on this, I've convinced myself that I should specify the model as:

fit <- lme(fixed = growth ~ (x1 + x2 + x3+ x4 + x5)^2, random = ~1|year, method = 'ML')

Year is clearly a random effect, and is the grouping variable for the analysis.  Each of the other coefficients is "inner" to this variable.  I'm ignoring individual tree as a grouping factor, since I don't want to estimate separate coefficients for each tree.  Does this sound like the correct way to do this?

Thanks for any help.  Apologies if this is more of a statistics question and less of an R question.

Matt Landis

****************************************************
R. Matthew Landis, Ph.D.
Dept. Biology
Middlebury College
Middlebury, VT 05753

tel.: 802.443.3484
**************************************************


	[[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list