One method is to use a chi-squared test for homogeneity.
Let's compare A+ and B+. The test is a bit difficult because
counts for 'Stage5' and 'Unknown' are so small for B+. The null hypothesis is that the (proportions of) 'Stages' are similarly distributed in A+ and B+.
This test requires a contingence table such as TAB
below:
A = c(124, 45, 234, 64, 163)
B = c(12, 19, 4, 5, 5)
sum(A); sum(B)
[1] 630
[1] 45
TAB = rbind(A,B); TAB
[,1] [,2] [,3] [,4] [,5]
A 124 45 234 64 163
B 12 19 4 5 5
Then in R, chisq.test
gives the following output:
chisq.test(TAB)
Pearson's Chi-squared test
data: TAB
X-squared = 68.75, df = 4, p-value = 4.166e-14
Warning message:
In chisq.test(TAB) :
Chi-squared approximation may be incorrect
The expected counts $E_{ij}$ for this test are found from row and column
totals based on the null hypothesis that the 'Stage' distributions
are the same for A+ and B+. If all of the $E_{ij} > 5,$ then the chi-squared
statistic $Q = 68.75:$ $$Q = \sum_{i=1}^5\sum_{j=1}^2\frac{(X_{ij}-E_{ij})^2}{E_{ij}}
\stackrel{aprx}{\sim}\mathsf{Chisq}(\nu = (5-1)(2-1_ = 4),$$
where $X_{ij}$ are entries in TAB
.
For your data the $E_{ij}$ are shown below. Notice that the row for B has
two counts barely below $5.$ Thus, the very small P-value, indicating that
$H_0$ should be rejected, may not be accurate. Even so, no $E_{ij}$ is much less than $5,$ and the P-value is very far below 5%. So it one can guess that rejecting $H_0$
is the correct decision.
chisq.test(TAB)$exp
[,1] [,2] [,3] [,4] [,5]
A 126.933333 59.733333 222.13333 64.4 156.8
B 9.066667 4.266667 15.86667 4.6 11.2
Warning message:
In chisq.test(TAB) :
Chi-squared approximation may be incorrect
However, the implementation of chisq.test
in R, permits simulating
a more accurate P-value (using parameter sim=T
), so guessing is not necessary.
The accurate P-value is $0.0005 < 0.01 = 1\%$ and we may reject at the 1% level
of significance.
chisq.test(TAB, sim=T)
Pearson's Chi-squared test
with simulated p-value
(based on 2000 replicates)
data: TAB
X-squared = 68.75, df = NA, p-value = 0.0004998
Notes: You can find a description of the chi-squared test of homogeneity
in most applied statistics books. In case you are not familiar with the
method of computing the $E_{ij},$ the R code below illustrates computation
of $E_{11} = 126.933333.$ Other expected counts are found similarly. "Row total times column total divided by grand total." (Do not round expected counts to integers when computing $Q.)$
rowSums(TAB)
A B
630 45
colSums(TAB)
[1] 136 64 238 69 168
sum(TAB)
[1] 675
630*136/675
[1] 126.9333