[R-sig-ME] Compute a repeated measures model in lme4

Mario Garrido gaiarrido at gmail.com
Tue Jun 9 14:17:33 CEST 2015


Hi again,
I got another question regarding the random factors.
when I compare models with nested random structures using REML as Zuur
recommended, I found this
> lme1<-lmer(O2.intake4days~1+(1|indiv),REML=FALSE)
> lme2<-lmer(O2.intake4days~1+(daytype|indiv),REML=FALSE)
> lme3<-lmer(O2.intake4days~1+(time|indiv),REML=FALSE)
> lme4<-lmer(O2.intake4days~1+(time+daytype|indiv),REML=FALSE) I compute
this but I am not very sure about the significance of it
> anova(lme1,lme2,lme3,lme4)
Data:
Models:
lme1: O2.intake4days ~ 1 + (1 | indiv)
lme2: O2.intake4days ~ 1 + (daytype | indiv)
lme3: O2.intake4days ~ 1 + (time | indiv)
lme4: O2.intake4days ~ 1 + (time + daytype | indiv)
     Df     AIC     BIC logLik deviance    Chisq Chi Df Pr(>Chisq)
lme1  3 -1115.6 -1106.2 560.81  -1121.6
lme2  5 -1111.6 -1096.0 560.81  -1121.6   0.0070      2     0.9965
lme3  5 -1388.2 -1372.6 699.09  -1398.2 276.5637      0     <2e-16 ***
lme4  8 -1384.7 -1359.7 700.33  -1400.7   2.4701      3     0.4807

*Daytype* is time before and after a treatment and *time* is if is night or
day. I know that individuals consumption is clearly different between night
and day.
So for each individual I got 4 data points. One for day before, one for day
after one for night before and one for night after. If there are changes
should be comparing day before and after and night before and after.
Got the random effect (time|indiv) sense in this way??
I looked in several place but I am not still sure.

Thanks, and sorry for such specific question


2015-06-08 21:41 GMT+03:00 Mario Garrido <gaiarrido at gmail.com>:

> What a complete review of my study! Thanks very much. I got open Zuur
> (2007) in this moment.
>
> Mario
>
> 2015-06-08 21:38 GMT+03:00 Philippi, Tom <tom_philippi at nps.gov>:
>
>> The draft R-sig-mixed FAQ has some guidance on testing random effects
>> (and LRT via anova are not recommended):
>> http://glmm.wikidot.com/faq
>>
>> Be careful.  In my applications of repeated measures to ecological data,
>> one model or the other for random effects is justified by the structure of
>> the sampling or experiment, and by the question of interest, not by
>> parsimony.
>>
>> Also, if your O2 measurements have cyclic/periodic responses to time of
>> day, at the least I urge you to spend quality time with papers or books,
>> such as Faraway's "Extending the linear model" or Wood's "Generalized
>> additive models" or perhaps one of Zuur's, to fully understand the
>> differences between treatments in the data that are estimated or tested by
>> different models.
>>
>> Ecologically, you may be more interested in specific parameters about the
>> O2 consumption: integrated 24hr consumption, estimated peak consumption,
>> shifts in time of peak consumption, rate of ramping up of consumption (your
>> rate of change of O2 might be a ramping up or ramping down following some
>> exertion).
>>
>> Tom 2
>>
>> On Mon, Jun 8, 2015 at 11:18 AM, Mario Garrido <gaiarrido at gmail.com>
>> wrote:
>>
>>> sorry, I reply without finishing my comments.
>>> I am trying to compare the rate of change in O2 consumption in 2
>>> consecutive days after a treatment (some individuals are treated while
>>> others do not) days. This is my treatment variable.
>>> daytype variable got 2 levels. the day before treatment and the day
>>> after treatment
>>> age variable are either juveniles or adults and time is time of teh day,
>>> dark and night.
>>>
>>> As I comparing the O2 consumption between day before and after. Random
>>> effect should be  1|individual) or (1+time|individual)?
>>>
>>>
>>> I always got the doubt.
>>>
>>> thanks!
>>>
>>> 2015-06-08 21:12 GMT+03:00 Mario Garrido <gaiarrido at gmail.com>:
>>>
>>>> This is really very useful, also what you tell about the random effect.
>>>> I just wondering about it right now.
>>>>
>>>> Thanks very much. I will look at with detail and get back here if
>>>> needed.
>>>>
>>>>
>>>>
>>>> 2015-06-08 20:53 GMT+03:00 Philippi, Tom <tom_philippi at nps.gov>:
>>>>
>>>>> Mario--
>>>>> Yes your formula is redundant.  It may or may not describe the model
>>>>> you are interested in.
>>>>> Look at the documentation for formula specification:
>>>>> * as in
>>>>> treatment*daytype*time*age
>>>>> includes both the individual main effects and the interactions up to
>>>>> the 4-way interaction, so your other terms are already included.
>>>>> : specifies an interaction.
>>>>>
>>>>> If you only want main effects plus those 3 2-way interactions, you can
>>>>> use something like:
>>>>> lme.mean7<-lmer(averageba~ treatment+daytype+time+age+
>>>>>                              age:activity+ time:activity+treatment:
>>>>> daytype+
>>>>>                             (1|indiv), REML = FALSE)
>>>>> Again, ?formula will help you with the syntax to specify the model you
>>>>> are interested in.
>>>>>
>>>>> Also, think hard about your random effect.  While there are some
>>>>> repeated measures models where (1|individual) is appropriate, in many cases
>>>>> (1+time|individual) or equivalently (time|individual) is more appropriate
>>>>> and informative.
>>>>>
>>>>> I hope that this helps get you pointed in the right direction.
>>>>>
>>>>> Tom 2
>>>>>
>>>>>
>>>>> On Mon, Jun 8, 2015 at 1:07 AM, Mario Garrido <gaiarrido at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> ​Dear list,
>>>>>> I am interesting in introduce in the same model ​these following
>>>>>> groups of
>>>>>> variables
>>>>>> treatment*daytype*time*age
>>>>>> age*activity
>>>>>> time*activity
>>>>>> treatment*daytype+activity
>>>>>>
>>>>>> Is this the correct way to do it? or is redundant and I get spurious
>>>>>> results?
>>>>>> lme.mean7<-lmer(averageba~ treatment*daytype*time*age+age*activity+
>>>>>> time*activity+treatment*daytype+activity+(1|indiv), REML = FALSE)
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>>         [[alternative HTML version deleted]]
>>>>>>
>>>>>> _______________________________________________
>>>>>> R-sig-mixed-models at r-project.org mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

	[[alternative HTML version deleted]]



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