I have a table of counts with 4 columns and 25 rows. What statistical test should be used to asses significance for values within each row? In other words I want to perform significance testing on individual rows to see if there is homogeneity. I was thinking of something similar to rowwise ANOVA, except I have counts instead of means. Can chi squared be performed on individual rows? I am using R to perform this analysis.

Edit: Mainly, I want to do a significance test of each row, so 25 tests. However, I'm not sure whether a chi-squared test for just 4 values would make statistical sense.

  • $\begingroup$ What do you mean by 'homogeneity'? Check if each row is consistent with probability 1/4 in each cell? Or see if rows are consistent with each other? // It would help if you could tell us what you are doing, what is being counted, typical sizes of counts, and what you want to know. $\endgroup$
    – BruceET
    Apr 17, 2022 at 3:49
  • $\begingroup$ By homogeneity I just mean making sure there is no significant variance between cells of each row. Each row corresponds to a different biological process. Each cell represents the count of proteins that are associated with that biological process. Each column represents a different sample. I want to test each row individually because row 1 might have a range of 130-150 while row 2 might have a range of 3–10. $\endgroup$ Apr 17, 2022 at 3:57
  • $\begingroup$ This will likely go better with a more informative question. Please edit. // If you want 25 tests, one on each row, then in R, code r = c(23,15,25,40); chisq.test(r) rejects probability 1/4 in each cell with P-value near $0$ for that one row. // Do you want no comparisons among the 25 rows? If not, why mention them? What if half the rows had proportions $(.2, .2, .2, .4)?$ Would that be interesting? $\endgroup$
    – BruceET
    Apr 17, 2022 at 4:35
  • 1
    $\begingroup$ Yes I want to do a significance test of each row, so 25 tests. I wasn’t sure if a chi squared test for just 4 values would make statistical sense $\endgroup$ Apr 17, 2022 at 4:40
  • $\begingroup$ Edited your Q. Reversed vote to close. Please do more editing as appropriate. // If you do 25 individual tests on the rows---all at the 5% level---do not be surprised if one of them happens to show inconsistency with 1/4 in each cell. $\endgroup$
    – BruceET
    Apr 17, 2022 at 5:05

1 Answer 1


Assuming the counts are large enough, a chisquare test for just 4 values makes statistical sense. You must just be prepared for the multiplicity problems of making many tests, so the p-values cannot be taken at face value, some multiple testing correction must be done.

With simulated data, 25 rows so 25 pvalues, we cam make a qqplot against the uniform distribution:

qqplot of 25 pvalues

which seems consistent with the null hypothesis, which is true in this simulation. The R code used:

set.seed(7*11*13)  # My public seed
tab <- matrix(as.integer(NA), nrow=25, ncol=4) 
for (i in 1:25) tab[i, ] <- 
   table(factor(sample(1:4, 100, replace=TRUE, prob=rep(1/4, 4)),

pvals <- rep(0, 25)
for (i in 1:25) pvals[i] <- chisq.test(tab[i, ])$p.value 

qqplot(ppoints(25), pvals) 
qqline(pvals, distribution=qunif, col="red") 

You could of course equally well have done a qqplot of the 25 observed chisquare test statistics against the chisquared distribution with 1 df.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.