boxm.test: Box-M test statistic

View source: R/boxm_test.R

boxm.testR Documentation

Box-M test statistic

Description

This function computes the Box M test statistic for testing equality of covariance matrices. The p-value is computed using either a chi-squared or F approximation.

Usage

boxm.test(x, y, type = "chi.squared")

Arguments

x

data matrix of first group with rows representing the samples and columns representing variables.

y

data matrix of second group with same number of columns as x

type

Distribution to use for calculating the p-value. Possible values are "chi.squared"(Default) and "F"

Value

A list with two values

test.statistic

The test statistic value

p.value

The p-value computed using the distribution specified in type

References

T. W. Anderson. An introduction to multivariate statistical analysis. Wiley Series in Probability and Statistics, 3rd edition, 2003.

Examples

library(mvtnorm)
x = rmvnorm(n = 100, mean = numeric(10), sigma = diag(10))
y = rmvnorm(n = 100, mean = numeric(10), sigma = diag(10))
boxm.test(x, y)

dnayyala/cramp documentation built on June 27, 2023, 1:34 p.m.