Box's M test for equality of two or more covariance matrices {mvhtests}R Documentation

Box's M test for equality of two or more covariance matrices

Description

Box's M test for equality of two or more covariance matrices.

Usage

Mtest.cov(x, ina, a = 0.05)

Arguments

x

A matrix containing Euclidean data.

ina

A vector denoting the groups of the data.

a

The significance level, set to 0.05 by default.

Details

According to Mardia, Kent and Bibby (1979, pg. 140), it may be argued that if nin_i is small, then the log-likelihood ratio test (function likel.cov) gives too much weight to the contribution of S{\bf S}. This consideration led Box (1949) to propose another test statistic in place of that seen in likel.cov . Box's MM is given by

M=γi=1k(ni1)logSi1Sp, M=\gamma\sum_{i=1}^k\left(n_i-1\right)\log{\left|{\bf S}_{i}^{-1}{\bf S}_p \right|},

where γ=12p2+3p16(p+1)(k1)(i=1k1ni11nk)\gamma=1-\frac{2p^2+3p-1}{6\left(p+1\right)\left(k-1\right)}\left(\sum_{i=1}^k\frac{1}{n_i-1}-\frac{1}{n-k}\right) and Si{\bf S}_{i} and Sp{\bf S}_{p} are the ii-th unbiased covariance estimator and the pooled covariance matrix, respectively with Sp=i=1k(ni1)Sink{\bf S}_p=\frac{\sum_{i=1}^k\left(n_i-1\right){\bf S}_i}{n-k}. Box's MM also has an asymptotic χ2\chi^2 distribution with 12(p+1)(k1)\frac{1}{2}\left(p+1\right)\left(k-1\right) degrees of freedom. Box's approximation seems to be good if each nin_i exceeds 20 and if kk and pp do not exceed 5 (Bibby and Kent (1979) pg. 140).

Value

A vector with the the test statistic, the p-value, the degrees of freedom and the critical value of the test.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Mardia K.V., Kent J.T. and Bibby J.M. (1979). Multivariate Analysis. London: Academic Press.

See Also

equal.cov, likel.cov

Examples

x <- as.matrix( iris[, 1:4] )
ina <- iris[, 5]
Mtest.cov(x, ina)

[Package mvhtests version 1.0 Index]