Luigi Marongiu
2022-Jan-04 10:55 UTC
[R] how to run r biotools boxM terst on multiple groups?
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
Hi. Not sure if statistically correct but what about iris$int<- interaction(iris$bin, iris$Species) boxM(iris[,1:4], iris[,7]) Cheers Petr> -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of Luigi Marongiu > Sent: Tuesday, January 4, 2022 11:56 AM > To: r-help <r-help at r-project.org> > Subject: [R] how to run r biotools boxM terst on multiple groups? > > 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, butit> 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 multiplegroups> simultaneously? > Thanks > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.