Skip to contents

boxM performs the Box's (1949) M-test for homogeneity of covariance matrices obtained from multivariate normal data according to one or more classification factors. The test compares the product of the log determinants of the separate covariance matrices to the log determinant of the pooled covariance matrix, analogous to a likelihood ratio test. The test statistic uses a chi-square approximation. Uses permutations to estimate the degrees of freedom under the null

Usage

boxM_fast(Y, group, method = c("pearson", "spearman"))

Arguments

Y

response variable matrix

group

a factor defining groups, number of entries must equal nrow(Y)

method

Specify type of correlation: "pearson", "spearman"

See also

heplots::boxM

Examples

data(iris)

boxM_fast( as.matrix(iris[, 1:4]), iris[, "Species"])
#> $Si_logDet
#>           [,1]
#> [1,] -1.040269
#> [2,] -2.481781
#> [3,] -1.984930
#> 
#> $dfs
#>      [,1]
#> [1,]   49
#> [2,]   49
#> [3,]   49
#> 
#> $dfchi
#> [1] 20
#> 
#> $pval
#> [1] 5.455647e-08
#> 
#> $X2
#> [1] 73.1845
#> 
#> $logdet
#> [1] -1.040269 -2.481781 -1.984930
#> 
#> $stat_logdet
#> [1] NA
#>