[R-sig-ME] ANCOVA with repeated measures

Ben Bolker bbolker at gmail.com
Tue Nov 29 14:15:52 CET 2011


Ricardo Solar <rrsolar at ...> writes:

> 
> Hi Ben;
> 
> It's exactly what I needed, the only (very simple indeed) question I have
> is. In what case in lmer do I need to use:
> 
> either: lmer(y~x*t+(1|f),data=D)
> 
> or: lmer(y~x*t+(*x*|f),data=D)
> 
> I mean, what is the effect of include another variable with the random
> factor? I'd read it before, though I couldn't realise well what it means. I
> saw that the significance drops down in the second case ...
> 
> If you can clarify this issue all my problems are solved at least for now!
> :p

  You use (x|f) if you want a random-slope model; i.e., if your experimental
design makes it reasonable to examine the variation in the effect of
the covariate across fragments.  You can only do this if you have
samples with varying x within a single fragment (e.g. a randomized
block design).  (You may have low power to detect such variation
even when it is theoretically possible to do so.)
   For example, suppose that x was temperature, which varied among
fragments and across years.

x+t+(1|f): temperature has the same effect every year and in every fragment
x*t+(1|f): temperature has different effects in every year, but the same
           in every fragment
x*t+(x|f): temperature has different effects in every year, and the
           temperature effect varies across fragments



> 
> Thanks a lot!
> 
> On 29 November 2011 10:54, Ben Bolker <bbolker at ...> wrote:
> 
> > Ricardo Solar <rrsolar at ...> writes:
> >
> > >
> > > Hi everyone;
> > >
> > > I'm trying to analyse a dataset coming from samples of the same forest
> > > fragments along 3 consecutive years. However, I'm trying to find a way to
> > > consider in the analyses the temporal pseudo-replication in the data. Do
> > > anyone have some idea about how can I solve this issue?
> >
> >   You haven't given us very much detail nor told us what you've tried
> > so far, but I will suppose that you have a data frame D
> > containing a normally distributed response
> > variable y, a covariate x, a fragment factor f, and a year variable
> > (factor) t (I will assume there is a single value of y measured
> > per fragment per year.  Then the standard way to deal with this would be
> >
> >  lme(y~x*t,random=~1|f,data=D)
> >
> > or
> >
> >  lmer(y~x*t+(1|f),data=D)
> >
> >  You should treat year (t) as a fixed rather than a random effect
> > because it won't be practical to estimate the variance of a random
> > effect with only three levels.
> >
> >  Ben Bolker
> >
> > _______________________________________________
> > R-sig-mixed-models at ... mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
>




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