Hotelling.mat {smsets} | R Documentation |
Hotelling's T^2
test with extra information
Description
An R function which implements Hotelling's T^2
test assuming equal
covariance matrices, with extra information.
Usage
Hotelling.mat(x, group, level1)
Arguments
x |
a data frame with one two-level factor and p response variables. |
group |
two-level factor defining groups. It must be one of the columns
in |
level1 |
a character string identifying Sample 1. The string must be one
of the factor levels in |
Details
This function is a simplified version of the function
hotelling.test
implemented in the Hotelling
package for the comparison of mean values of two multivariate samples, under
the assumption that covariance matrices are equal. The summary
methods
in Hotelling.mat
gives more detailed information of the calculations
behind the T^2
test.
Value
Returns an object of class "Hotelling.mat"
, a list containing
the following components:
name | A character string describing the function. | |
T2.list | A list containing two data frames with the mean vector
for the two samples, two covariance matrices, one matrix per sample,
the pooled covariance matrix, the inverse of the pooled covariance matrix,
the Hotelling's T^2 statistic, the F -statistic, the degrees of
freedom for the F -statistic and the P-value.
| |
group | a character string specifying the name of the two-level factor defining groups. | |
levels.group | a vector of length two, showing the two levels in
factor group . | |
data.name | a character string giving the name of the data. | |
data | the data frame analyzed. | |
Author(s)
Jorge Navarro Alberto, ganava4@gmail.com
References
Manly, B.F.J., Navarro Alberto, J.A. and Gerow, K. (2024) Multivariate Statistical Methods. A Primer. 5th Edn. Chapman and Hall/CRC.
Examples
data(sparrows)
results.T2 <- Hotelling.mat(sparrows, group = Survivorship, level1 = "S")
# Brief output
results.T2