HT2test {MVET} | R Documentation |
Hotelling T Square Test
Description
The mean vector test (Hotelling T square test) to compare one sample or two samples that satisfy the multivariate normality test and the homogeneity of covariance matrices test.
Usage
HT2test(data1,
data2,
mu0 = NULL,
sample = "two",
plot.scale = FALSE)
Arguments
data1 |
The data frame or matrix must consist of only numbers, and the data must consist of only a single group or class. It should not contain columns that separate groups or classes. |
data2 |
The data frame or matrix must consist of only numbers, and the data must consist of only a single group or class. It should not contain columns that separate groups or classes. The |
mu0 |
The mu0 is used to test the mean vector hypothesis of |
sample |
The options for specifying the number of groups for group comparisons are |
plot.scale |
If |
Value
One.HT2 |
The Hotelling T square test in one-sample, showing the degrees of freedom required for the F test, the Hotelling t square statistic, the F test statistic, and the probability of significance. |
Mean.val.plot |
Plot the mean value parallel coordinates, representing the two samples using the mean values for each variable. |
Two.HT2 |
The Hotelling T square test in two-sample, showing the degrees of freedom required for the F test, the Hotelling t square statistic, the F test statistic, and the probability of significance. |
References
Johnson, R. A., & Wichern, D. W. (2007). Applied Multivariate Statistical Analysis (6th ed.). Pearson Prentice Hall.
See Also
mardiatest for multivariate normality (Includes outlier remove)
PPCCtest for multivariate normality
SPCCtest for multivariate normality
boxMtest for homogeneity of covariance matrices
Examples
data(wine)
class1.wine <- subset(wine, class == 1)[, -1]
class2.wine <- subset(wine, class == 2)[, -1]
modified.class2.wine <- outlier(class2.wine, lim = 0, level = 0.05, option = "all")$modified.data
## one sample
value <- 0
p <- ncol(class1.wine)
mu0 <- matrix(rep(value, p), nrow = p, ncol = 1)
HT2test(data1 = class1.wine, mu0 = mu0, sample = "one")
## two sample
HT2test(data1 = class1.wine, data2 = modified.class2.wine, sample = "two", plot.scale = TRUE)