# Test equality of multiple proportions

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]))

• you can perform the chi square test. – A Gore Feb 28 '16 at 1:20
• Right, just chisq.test(M). – Antoni Parellada Feb 28 '16 at 2:39