[R] post hoc tests two way repeated measures anova

Jean-Pierre Bresciani bresciani at tuebingen.mpg.de
Mon Aug 18 15:02:28 CEST 2008


and thanks for the advices. I actually tried using 'lme', but haven't
figured out the appropriate syntax to get the random error correct with
repeated measures.
let's say i have 3 independent variables, with 'aov', i would write
something like: aov(dep_var~(indep_var1*indep_var2*indep_var3) +

With 'lme' however, i can't find the right formula. i tried things like:
lme(dep_var~(indep_var1*indep_var2*indep_var3), random = ~1|subject) or
nesting my independent variables in 'subject', but those are obviously wrong
with my design.

i'm quite clueless (and i haven't found any convincing piece of information
about how to correctly use 'lme' or 'lmer'). So, any advice along that line
is more than welcome.


Frank E Harrell Jr wrote:
> Dieter Menne wrote:
>> Jean-Pierre Bresciani <bresciani <at> tuebingen.mpg.de> writes:
>>> is there a specific/appropriate function/package to perform post hoc
>>> tests
>>> when running a two way repeated measures anova? I'm looking for
>>> something
>>> that will be equivalent to the 'TukeyHSD()' for between subjects anova
>>> (with
>>> 'aov()'). For one way repeated measures anova, the 'pairwise.t.test()'
>>> function seems to work correctly but the results are questionable for
>>> two+
>>> way anovas, as if the adjustment of the p values for multiple
>>> comparisons
>>> was not correct.
>> Classical repeated measurement has fallen a bit out of favor, because
>> mixed
>> models as in lme (package nlme) and lmer(package lme4) are MUCH more
>> flexible
>> and in general more stable when data are missing.
> And don't forget generalized least squares (gls in nlme) which has the 
> same advantages using only fixed effects.
> Frank
>> So I recommend to switch to lme (better documented, currently), and use
>> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/20725.html
>> as a starter when trying to do multiple comparisons.
>> Dieter Menne (Tübingen)
> -- 
> Frank E Harrell Jr   Professor and Chair           School of Medicine
>                       Department of Biostatistics   Vanderbilt University
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

View this message in context: http://www.nabble.com/post-hoc-tests-two-way-repeated-measures-anova-tp18999089p19031169.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list