2
$\begingroup$

Conciser a cross-tab like this (or equivalent just with different number of either classes or folds):

         Classes
       A  B  C  D
Fold1 12 10 12 14
Fold2 10 12 14 12
Fold3 14 10 12 12
Fold4 20 28 20 20
Fold5 14 10 12 12

How should one check, if proportions of classes' A, B, C, and D frequencies in each fold (i.e. proportions in each row) are (approximately) equal?
How can a solution be implemented in R?

R code to reproduce the table:

M <- matrix(c(12, 10, 12, 14,
              10, 12, 14, 12,
              14, 10, 12, 12,
              20, 28, 20, 20,
              14, 10, 12, 12),
           nrow = 5,
           byrow = TRUE,
           dimnames = list(paste0("Fold",1:5),LETTERS[1:4]))
$\endgroup$
  • 1
    $\begingroup$ you can perform the chi square test. $\endgroup$ – A Gore Feb 28 '16 at 1:20
  • $\begingroup$ Right, just chisq.test(M). $\endgroup$ – Antoni Parellada Feb 28 '16 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.