[R-sig-ME] advice with lmer syntax

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Fri Jan 22 11:16:11 CET 2010


Dear Giacomo,

You want a different random intercept for Season or Tide per site. Use
(Season|Site) instead of (1|Season:Site)

In your case I would not use site as a random site since you have only 3
sites. That won't give you a good estimate of the variance. Therefore I
would use Site as a fixed effect. It only requires one d.f. extra so
that should not be a big problem.

Mod1<- lmer(Activity~Season*Tide + Site+ (1|Site:Animal) , data=obsTot,
REML=TRUE)

The (1|Site:Animal) indicates a random effect per animal, assuming that
you reuse the animal Ids among sites. If all animals have a unique ID
you can use (1|Animal).

If you want to test the difference in Season effect among sites then you
just have to add the interaction between Season and Site.

HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces at r-project.org
[mailto:r-sig-mixed-models-bounces at r-project.org] Namens Giacomo Santini
Verzonden: vrijdag 22 januari 2010 10:56
Aan: r-sig-mixed-models at r-project.org
Onderwerp: [R-sig-ME] advice with lmer syntax

Dear all,

here is my problem, a very  simple one indeed. I am new to mixed models
and before go on with the analysis I wish to be sure I am rigth in model
formulation.

My data set consists of  observations on the behaviour (say time active,
Activity) of marine animals. I have 120 individually marked animals in
three different randomly chosen sites (40 animals per site). I was
interested in assessing if the behaviour changed during A) different
seasons and  B) different tidal conditions.
For each animal in each site the behaviour was observed during three
different randomly chosen days within each combination of Season (A) and
Tide (B). Obviously each individual is specific to one of the three
sites. In summary:

Season, fixed factor, 2 levels (Summer,    Winter)
Tide, fixed, 2 levels (Neap and Spring)
Site, random factor, 3 levels
Animal, random factor, 120 levels, nested within Site

I wish to analyse this data set using lme4. I guess the starting model
to answer to questions A, B and C is

Mod1<- lmer(Activity~Season*Tide + (1|Site)+ (1|Site/Animal) ,
data=obsTot, REML=TRUE)

Now if I wish to check if the effect of Season and Tide differs in the
different sites (altough I am not interested in these tree sites in
particular) would it be correct to add to Mod1 terms like
(1|Season:Site) and or, (1|Tide:Site)? Something like:

Mod2<- lmer(Activity~Season*Tide + (1|Site)+ (1|Site/Animal) +
(1|Season:Site)+ (1|Tide:Site), data=obsTot, REML=TRUE)

Any suggetion is welcome

Cheers
Giacomo

--
-------------------------------------------------------
Giacomo Santini PhD
Dipartimento di Biologia Evoluzionistica "Leo Pardi"
Universita' degli Studi di Firenze
Via Romana 17
I-50125 Firenze
Italy

Tel: +39 055 2288288 (DBE) - +39 0574 447727 (CESPRO)
Fax: +39 055 2288289
www.dbe.unifi.it/santini

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

Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.




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