Learn R Programming

smsets (version 2.0.0)

print.Hotelling.mat: Prints Hotelling's \(T^2\) test

Description

Prints the results produced by the Hotelling.mat function

Usage

# S3 method for Hotelling.mat
print(x, long = FALSE, ...)

Value

Displays the results of the comparison of mean values of two multivariate samples, under the assumption that covariance matrices are equal, using Hotelling's T² test. The argument x, invisibly, as for all print methods, is a list of class "Hotelling.mat". This print method provides two sorts of output depending on whether the long argument is TRUE or FALSE

(the default). The "short" output displays:

  • A description of the analysis.

  • The data frame analyzed.

  • The labels of the two-level group factor (samples), with an order determined by the user in the Hotelling.mat argument level1.

  • The value of Hotelling's \(T²\)-statistic.

  • The value of the F-statistic with its corresponding degrees of freedom for numerator and denominator.

  • The P-value.

In addition to this summary, the "long" output shows:

  • The mean vectors and covariance matrices for each sample.

  • The pooled covariance matrix.

  • The inverse of the covariance matrix.

Arguments

x

an object of class "Hotelling.mat"

long

a logical variable indicating whether a long output is desired (TRUE) or not (FALSE, the default)

...

further arguments passed to or from other methods.

Examples

Run this code
data(sparrows)
results.T2 <- Hotelling.mat(sparrows, group = Survivorship, level1 = "S")
# Long output
print(results.T2, long = TRUE)

Run the code above in your browser using DataLab