[R] Posthoc tests for 3-way ANOVA analysis

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Tue Oct 24 11:56:05 CEST 2006


On Tue, 24 Oct 2006, A Ezhil wrote:

> Hi All,
>
> I have performed a 3-way ANOVA analysis for my
> experimental data using aov function. My simple R
> funtion for this is:
>
> 3aof <- function(x){
> m <- data.frame(R,S,T, x);
> anova(aov(x ~ R+S+T+R*S+R*T+S*T+R*S*T, m) )
> }
>

you can use

R> library("multcomp") ### check for version 0.991-1

for some model

R> amod <- aov(x ~ R+S+T+R*S+R*T+S*T+R*S*T, m)

with, say, all-pair comparisons of the levels of `T':

R> posth <- glht(amod, linfct = mcp(T = "Tukey"))

various adjusted p-values can be computed using

R> summary(posth)

and confidence intervals (adjusted and unadjusted) are available from

R> confint(posth)


Hope that helps,

Torsten


> Now, I am getting P values for all the main and
> interactions effects. If I want to perform postdoc
> test on one of my main effects, say T, what method I
> should use (i have unequal sample size)? Is there
> anyway I can extend my above '3aof' function to do
> this?
>
> I greatly appreciate your help. Thanks in Advance.
>
> Regards,
> Ezhil
> Ph.D Student
> School of Biotechnology
> AU, India.
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>
>



More information about the R-help mailing list