Description Usage Arguments Value Methods (by class) Author(s) References See Also Examples
View source: R/hotelling.test.r
Performs a twosample Hotelling's Tsquared test for the difference in two multivariate means
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  hotelling.test(x, ...)
## Default S3 method:
hotelling.test(
x,
y,
shrinkage = FALSE,
var.equal = TRUE,
perm = FALSE,
B = 10000,
progBar = (perm && TRUE),
...
)
## S3 method for class 'formula'
hotelling.test(x, data = NULL, pair = c(1, 2), ...)

x 
a matrix containing the data points from sample 1, or a formula
specifying the elements to be used as a response and the grouping variable
as a predictor, or a list containing elements 
... 
any additional arguments. This is useful to pass the optional arguments for the default call from the formula version 
y 
a matrix containing the data points from sample 2, or a list
containing elements 
shrinkage 
if 
var.equal 
set to 
perm 
if 
B 
if perm is TRUE, then B is the number of permutations to perform 
progBar 
if 
data 
a data frame needs to be specified if a formula is to be used to perform the test 
pair 
a vector of length two which can be used when the grouping factor
has more than two levels to select different pairs of groups. For example
for a 3level factor, pairs could be set to 
A list (which is also of class 'hotelling.test') with the following elements:
stats 
a list containing all of the output from

pval 
the Pvalue from the test 
results 
if 
default
: Twosample Hotelling's Tsquared test
formula
: Twosample Hotelling's Tsquared test
James M. Curran
Hotelling, H. (1931). “The generalization of Student's ratio.” Annals of Mathematical Statistics 2 (3): 360–378.
Schaefer, J., and K. Strimmer (2005). “A shrinkage approach to largescale covariance matrix estimation and implications for functional genomics.” Statist. Appl. Genet. Mol. Biol. 4: 32.
OpgenRhein, R., and K. Strimmer (2007). “Accurate ranking of differentially expressed genes by a distributionfree shrinkage approach.” Statist. Appl. Genet. Mol. Biol. 6: 9.
Campbell, G.P. and J. M. Curran (2009). “The interpretation of elemental composition measurements from forensic glass evidence III.” Science and Justice, 49(1),27.
hotelling.stat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33  data(container.df)
fit = hotelling.test(.~gp, data = container.df)
fit
subs.df = container.df[1:10,]
subs.df$gp = rep(1:2, c(5,5))
fitPerm = hotelling.test(Al+Fe~gp, data = subs.df, perm = TRUE)
fitPerm
plot(fitPerm)
data(bottle.df)
fit12 = hotelling.test(.~Number, data = bottle.df)
fit12
fit23 = hotelling.test(.~Number, data = bottle.df, pair = c(2,3))
fit23
data(manova1.df)
fit = hotelling.test(wratr+wrata~treatment, data = manova1.df, var.equal = FALSE)
fit
x = list(mean = c(7.81, 108.77, 44.92),
cov = matrix(c(0.461, 1.18, 4.49,
1.18, 3776.4, 17.35,
4.49, 17.35, 147.24), nc = 3, byrow = TRUE),
n = 13)
y = list(mean = c(5.89, 41.9, 20.8),
cov = matrix(c(0.148, 0.679, 0.209,
0.679, 96.10, 20.20,
0.209, 20.20, 24.18), nc = 3, byrow = TRUE),
n = 10)
fit = hotelling.test(x, y, var.equal = FALSE)
fit

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.