[R] TukeyHSD for multiple response

Michael Friendly |r|end|y @end|ng |rom yorku@c@
Sat May 26 17:28:20 CEST 2018


Hi Sergio

Doing those tests 30 times is going to give you a huge Type I error 
rate, even if there was a function that did that.  There is a reason
why TukeyHSD doesn't make it easy.

In general, if there are useful comparisons among the species, you are 
better off setting up and testing contrasts than doing all-pairwise
Tukey tests.

Also, the PCA scores are ordered in terms of variance acct'd for, so 
maybe only the first few are important.

Finally, you might be better off using Canonical Discriminant analysis 
than PCA followed by MANOVA.  The candisc package is well suited to this
task.  It can give you HE plots in the space that best discriminates
among the levels of an effect, and show how the original variables 
relate to (project into) that space.
CDA is sort of like PCA, but the goal is to account for maximum 
differences among groups rather than maximum total variance.

For proper partial Type III tests, use car::Manova rather than stats::manova
which only gives sequential, Type I tests

HTH
-Michael

On 5/25/2018 9:11 AM, Sergio Ferreira Cardoso wrote:
> Dear all,
> 
> I'm testing the effect of species and sex in my sample by using the principal component scores of a PCA analysis.
> I have 30 PCs and I tried to see if there is any significant difference from males to females, given that there is a significant effect of phylogeny (factor with several species).
> I didi it like this:
> 
> Y<-PCA$pc.scores[,1:30]
> fit <- manova(Y ~ sp*sex)
> summary(fit, test="Wilks")
> 
> I get a barely significant p-value for the effect of sex and I'd like to know for which of the species there is a difference between males and females.
> I tried TukeyHSD(fit) but I get the following error:
> 
> Error in model.tables.aov(x, "means") :
> 'model.tables' is not implemented for multiple responses
> 
> So this has to do with the fact that I have a multivariate independent variable. Is there an alternative function to this?
> 
> Thanks in advance,
> Sérgio.
> 


-- 
Michael Friendly     Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, ASA Statistical Graphics Section
York University      Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele Street    Web:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA




More information about the R-help mailing list