Description Usage Arguments Value Author(s) Examples
Chi-square approximation to Box's M test for equality of k covariance matrices, as described in Rencher (2002, p255).
1 | box.mtest(covmats, nvec)
|
covmats |
Array of k covariance matrices to be tested for equality. |
nvec |
Vector of sample sizes of the k groups. |
Returns a list with the values
p.value |
The p value for the test. |
S.pooled |
Pooled covariance matrix as used in the M-test, under the assumption of equal population covariance matrices. |
Theo Pepler
1 2 3 4 5 6 7 8 9 10 11 12 | ## Iris data
data(iris)
iris1 <- subset(iris, Species == 'setosa')
iris2 <- subset(iris, Species == 'versicolor')
iris3 <- subset(iris, Species == 'virginica')
## Array containing the covariance matrices
S <- array(NA, dim = c(4, 4, 3))
S[, , 1] <- cov(iris1[, 1:4])
S[, , 2] <- cov(iris2[, 1:4])
S[, , 3] <- cov(iris3[, 1:4])
## Box's M-test
box.mtest(covmats = S, nvec = c(50, 50, 50))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.