[R-sig-ME] lmer() syntax and model specification

W Duncan Wadsworth w.d.wadsworth at gmail.com
Tue Jul 3 19:34:30 CEST 2012


Hello All,

Even though I've read around I still find myself struggling with the model specification, and subsequently, the lmer() syntax for a project I'm working on. If anyone out there has comments or advice it would be greatly appreciated.

The design:

An experiment in plant ecology.  Two species, one measured from 2008-2011, the other measured from 2007-2011 (so species-by-year is not fully crossed).  Four treatments, crossed with three aspects (North, South, None), giving twelve distinct plots.  There are 3 to 8 trees of each species in each of the twelve plots and they are outfitted with sensors which provide the (normal) response variable. Some trees have died and others have been fitted with sensors to replace them.  The plot-level predictor is precipitation event so the long form of the data has a row for each tree's response to each rain event.  I would like to use year as a fixed factor where rain events are nested within years and consider the species and treatment trends over the available years.

What I think is a reasonable model:

for t = 2007, 2008, 2009, 2010, 2011 and i = tree number and j = treatment,

Response_tij = beta_0 + beta_1 * Year_t + beta_2 * Species_ij + beta_3 * Year_t * Species_ij + u_0j + u_1j * Year_t + u_0i|j + u_1i|j * rain event + epsilon_tij

What I think the lmer() syntax is for this model:

Response ~ 1 + Year : Species + (1 + Year | treatment) + (1 + rain event | treatment : tree number)

where tree number is coded "implicitly" using Prof. Bates' terminology. (See http://tolstoy.newcastle.edu.au/R/e12/help/10/11/3521.html .)  What I'm really going for is a model which fits varying slope and intercept regressions for each tree's responses to rain events, grouped by year, so that slopes and intercepts can be compared between treatments and across years.

Thanks in advance,
Duncan

P.S.  To further complicate things I have a number of site wide predictors and a tree level predictor that would ideally be considered in the model selection process.  Each of those predictors is rain event specific, i.e. it changes for each row of the long form data.  How could those predictor be brought in?  Also, where would aspect go?  More thanks.


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