[R] how to run r biotools boxM terst on multiple groups?

Luigi Marongiu m@rong|u@|u|g| @end|ng |rom gm@||@com
Tue Jan 4 11:55:43 CET 2022


I have a data frame containing a half dozen continuous measurements
and over a dozen ordinal variables (such as, death, fever, symptoms
etc).
I would like to run a box matrix test and I am using biotools' boxM,
but it allows to run only one ordinal group at the time. For instance:
```
>data(iris)
>boxM(iris[,1:4], iris[,5])

Box's M-test for Homogeneity of Covariance Matrices

data:  iris[, 1:4]
Chi-Sq (approx.) = 140.94, df = 20, p-value < 2.2e-16

>bins <- c(1,2); iris$bin <- findInterval(iris$Petal.Width, bins)
>iris$bin = factor(iris$bin)
>boxM(iris[,1:4], iris[,6])

Box's M-test for Homogeneity of Covariance Matrices

data:  iris[, 1:4]
Chi-Sq (approx.) = 140.94, df = 20, p-value < 2.2e-16

>boxM(iris[,1:4], iris[,5:6])
Error in boxM(iris[, 1:4], iris[, 5:6]) : incompatible dimensions!
```
Is there a way to check for equality of variance-covariance on
multiple groups simultaneously?
Thanks



More information about the R-help mailing list