Description Usage Arguments Details Value Author(s) References Examples
View source: R/hotelling.test.r
Calculate Hotelling's T-squared test statistic for the difference in two multivariate means.
1 | hotelling.stat(x, y, shrinkage = FALSE, var.equal = TRUE)
|
x |
a nx by p matrix containing the data points from sample 1 or a list containing elements |
y |
a ny by p matrix containg the data points from sample 2 or a list containing elements |
shrinkage |
set to |
var.equal |
set to |
Note, the sample size requirements are that nx + ny - 1 > p. The procedure will stop if this is not met and the shrinkage estimator is not being used. The shrinkage estimator has not been rigorously tested for this application (small p, smaller n).
A list containing the following components:
statistic |
Hotelling's (unscaled) T-squared statistic |
m |
The scaling factor - this can be used by by multiplying it with the test statistic, or dividing the critical F value |
df |
a vector of length containing the numerator and denominator degrees of freedom |
nx |
The sample size of sample 1 |
ny |
The sample size of sample 2 |
p |
The number of variables to be used in the comparison |
James M. Curran
Taylor Hersh
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 large-scale covariance matrix estimation and implications for functional genomics.” Statist. Appl. Genet. Mol. Biol. 4: 32.
Opgen-Rhein, R., and K. Strimmer (2007). “Accurate ranking of differentially expressed genes by a distribution-free shrinkage approach.” Statist. Appl. Genet. Mol. Biol. 6: 9.
NEL, D.G. and VAN DER MERWE, C.A. (1986). “A solution to the - multivariate Behrens-Fisher problem.” Comm. Statist. Theor.- Meth., A15, 12, 3719-3736.
1 2 3 4 5 6 | data(container.df)
split.data = split(container.df[,-1],container.df$gp)
x = split.data[[1]]
y = split.data[[2]]
hotelling.stat(x, y)
hotelling.stat(x, y, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.