Hotelling {asbio} | R Documentation |
The Hotelling T-sqaured test provides a multivariate analog for a univariate test of two populations.
Hotelling(Y, X)
Y |
An n x p matrix of quantitative Y variables. |
X |
A n x 1 vector describing a factor with two factor levels. |
Details are provided in any introductory text on multivariate statistics. The same result will be given if a one way MANOVA is run on the data.
Returns a list
D.sq |
The Mahalanobis distance between the factor levels based on a pooled covariance matrix. |
T.sq |
The T^2 test statistic |
table |
A table with the F-statistic summary including the test statistic, numerator and denominator degrees of freedom, and the p-value |
Ken Aho
Everitt, B. (2005) An R and S-plus companion to multivariate analysis. Springer.
Y1<-rnorm(100,15,3) Y2<-rnorm(100,17,2) X<-factor(c(rep(1,50),rep(2,50))) Hotelling(cbind(Y1,Y2),X) anova(lm(cbind(Y1,Y2)~X))