[R-sig-ME] ANCOVA with repeated measures

Ben Bolker bbolker at gmail.com
Tue Nov 29 13:54:13 CET 2011


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




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