I agree with @MichaelLew that you have not given enough details
for a definitive answer. However, let's explore one possible
specific scenario. It may answer your question and it may not. If not
please say what is wrong or incomplete about my scenario, and
maybe someone can use that information to provide what you need.
Suppose you have 200 subjects in each of the five groups. where
'5' is the control group. In each group, some sign up for the class (Yes) and some don't (No), giving a table similar to the fictitious
one below.
Group 1 2 3 4 5 Total
------------------------------------------
Yes 78 55 98 67 50 348
No 122 145 102 133 150 652
------------------------------------------
Tot 200 200 200 200 200 1000
Yes = c(78,55,98,67,50)
sum(Yes)
[1] 348
Tot = rep(200, 5)
No = Tot-Yes; No
[1] 122 145 102 133 150
TAB = rbind(Yes, No); TAB
[,1] [,2] [,3] [,4] [,5]
Yes 78 55 98 67 50
No 122 145 102 133 150
A chi-squared test of homogeneity tests the null hypothesis that,
in the population from which these 1000 subjects were chosen,
all five groups have the same probability of giving Yes responses.
This is done by comparing the observed counts $X_{ij}$ in TAB
with
expected counts computed, according to the null hypothesis, from row
and column totals. For example expected count
$E_{11} = (348)(127)/1000 = 44.196.$
In R, the chi-squared test (without continuity correction due to
relatively large counts), is as shown below. The P-value very near $0$ indicates strong evidence that the groups have significantly different
proportions of Yes's.
chisq.test(TAB, cor=F)
Pearson's Chi-squared test
data: TAB
X-squared = 32.641, df = 4, p-value = 1.415e-06
Now the question arises, which groups differ from which others.
The Pearson residuals having the largest absolute values. )The chi-squared statistic is the sum of the squares of the ten residuals.)
Here, it seems especially worthwhile comparing Groups 3 and 5.
chisq.test(TAB, cor=F)$res
[,1] [,2] [,3] [,4] [,5]
Yes 1.0068729 -1.750041 3.404189 -0.3116511 -2.349370
No -0.7355979 1.278539 -2.487022 0.2276851 1.716395
This ad hoc comparison can be made
using chisq.test
again, but with a sub-table of TAB
, limited to columns 3 and 5,
TAB[, c(3,5)]
[,1] [,2]
Yes 98 50
No 102 150
chisq.test(TAB[ ,c(3,5)], cor=F)
Pearson's Chi-squared test
data: TAB[, c(3, 5)]
X-squared = 24.71, df = 1, p-value = 6.662e-07
For your actual data, you can decide how many such
ad hoc comparisons to make. However, if you are
going to make five such comparisons you should use
a smaller significance level than 5% to avoid 'false
discovery, making multiple tests on the same data.
The Bonferroni method of avoiding false discovery
would divide 5% by 5 comparisons, so you should
find any one comparison to be significant only if
the P-value of the ad hoc test is smaller than 1%.