Learn R Programming

asbio (version 0.3-1)

Hotelling: Hotelling T-squared test

Description

The Hotelling T-squared test provides a multivariate analog for a univariate test of two populations.

Usage

Hotelling(Y, X)

Arguments

Y
An n x p matrix of quantitative Y variables.
X
A n x 1 vector describing a factor with two factor levels.

Value

  • Returns a list
  • D.sqThe Mahalanobis distance between the factor levels based on a pooled covariance matrix.
  • T.sqThe $T^2$ test statistic
  • tableA table with the F-statistic summary including the test statistic, numerator and denominator degrees of freedom, and the p-value

Details

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.

References

Everitt, B. (2005) An R and S-plus companion to multivariate analysis. Springer.

See Also

manova

Examples

Run this code
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))

Run the code above in your browser using DataLab