Re: [R] Pairwise comparison after repeated measures ANOVA

From: Dieter Menne <dieter.menne_at_menne-biomed.de>
Date: Thu 16 Feb 2006 - 02:06:36 EST

Felipe Martínez-Pastor <Felipe.Martinez <at> uclm.es> writes:

>
> I am analyzing some data obtained after measuring some parameters at
> different times in samples obtained from many subjects. The model is
> quite simple: aov(parameter ~ Time + Error(Subject/Time))
>
> Now I want to make a pairwise comparison between the levels of Time.
> However, I have not find how to do such a thing. I cannot use TukeyHSD
> or pairwise.t.test, I supposse. Maybe using contrasts?
>

I would suggest that you use lme from package nlme for this type of a problem, because it provides a MUCH better toolbox fro what noadays is called mixedeffect  models. And get the book by Pinheiro/Bates (Mixed-Effect Models in S and S-PLUS), which is full of practical examples of this type.

With the results of <lme>, you can use <estimable> from package gmodels to estimate contrasts, and p.adjust to adjust for multiple comparison. However, as you parameter is called Time, you should really rethink if this is the right way to go. Why not treat Time as and continuous variable, effectively estimating a slope? Or at least as an ordered variable? I know from my clients that, after measuring a parameter 6 instances in time, they insist on a starspangled  list of all 15 pairwise comparisons. If they do, I take out Bonferroni's Iron Claw even if I know better methods.

The question: "At what time intervals is the difference significant" is mostly nonsense.

Try to rephrase as "Is there a significant linear trend in time?". Would adding a quadratic component improve the quality of the fit (use AIC for this, see Pinheiro/Bates or Venables/Ripley). In many biological applications I know, a linear trend is perfectly fine, and it often has an easy interpretation. You only have to fight "but it's not linear" faculty, who mostly would not object to computing the mean without ever thinking to ask "but it's not constant".

Soapbox off. You see, I just had a discussion on the subject with a client.

Dieter



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Feb 16 02:12:56 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:31 EST