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 data2 is for comparison with data1 and is not used to compare one sample to another.

mu0

The mu0 is used to test the mean vector hypothesis of data1. It is only used to compare one-sample.

sample

The options for specifying the number of groups for group comparisons are one and two, where one is used to compare one-sample and two is used to compare two-samples. (default sample = two)

plot.scale

If TRUE, the data will be scaled before calculating mean values and used in the plot. It has no direct effect on the data. It only applies to two samples. (default plot.scale = FALSE)

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)



[Package MVET version 0.1.0 Index]