[R-sig-ME] Question on lmer use and commands

Reinhold Kliegl reinhold.kliegl at gmail.com
Tue Jun 10 12:26:49 CEST 2008


On Mon, Jun 9, 2008 at 11:35 PM, Peter S Coates <pcoates at usgs.gov> wrote:
> To R users,
>
> I am new to R and would appreciate any suggestions to my questions. I am
> modeling factors that influence point counts. My question is regarding the
> use and command lines of lmer. First, I have repeated measures per site
> (10-20 per site),  multiple years, and multiple spatial scales of each
> factor. The counts by day are different within each site but the
> explanatory data are the same and therefore do not vary (e.g., % cover). I
> have few sites with no overlap, even at the largest scales. I followed an
> example of mixed model use with longitudinal data from Faraway 2005 and
> modeled site and year as random effects. Example of my formula was:
> log(response) ~ hab1 + hab2 + (1 | year) + (1 | site). The models
> converged, no warnings, etc. Was this an appropriate model for these data?
> Also, do you suggest including a time component (e.g., timing of surveys
> partitioned into grouped days) , even though I am not necessarily
> interested in timing effects? If so, is it correct to model it as
> (time|site) instead of (1|time) and does time need to be additionally
> included as a fixed effect? Thank you very much for suggestions.
>
How does your time factor relate to year and site? For example, is it
nested within or crossed with year and site? How many units are in
your  random factors year, site, and (possibly) time?

The specification  "... + (time|site)" assumes that the size of the
time effect varies across sites. Typically, you will use this
specification if there are only a few levels of time (or if you can
use a few polynomial trends to summarize its effect). In this case,
the general recommendation is to include it also as a fixed effect.
This gives you the average effect of time plus the variance associated
of with the effect of time between sites around the fixed effect.

The specification " ... + (1|time)" assumes you have randomly sampled
the times, ideally each of many times many times. In this case, you
would normally not include it as fixed effect.

These are approximate answers only; there are probably better
specifications for your data, but they would require that you tell us
more details about your design.

Reinhold Kliegl




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