Professional Documents
Culture Documents
Chi Square Test of Homogeineity
Chi Square Test of Homogeineity
This lesson explains how to conduct a chi-square test of homogeneity. The test is
applied to a single categorical variable from two or more different populations. It is used
to determine whether frequency counts are distributed identically across different
populations.
The test procedure described in this lesson is appropriate when the following conditions
are met:
This approach consists of four steps: (1) state the hypotheses, (2) formulate an analysis
plan, (3) analyze sample data, and (4) interpret results.
Every hypothesis test requires the analyst to state a null hypothesis and an alternative
hypothesis. The hypotheses are stated in such a way that they are mutually exclusive.
That is, if one is true, the other must be false; and vice versa.
Suppose that data were sampled from r populations, and assume that the categorical
variable had c levels. At any specified level of the categorical variable, the null hypothesis
states that each population has the same proportion of observations. Thus,
The alternative hypothesis (𝐻𝑎 ) is that at least one of the null hypothesis statements is
false.
The analysis plan describes how to use sample data to accept or reject the null
hypothesis. The plan should specify the following elements.
Using sample data from the contingency tables, find the degrees of freedom, expected
frequency counts, test statistic, and the P-value associated with the test statistic. The
analysis described in this section is illustrated in the sample problem at the end of this
lesson.
𝑑𝑓 = (𝑟 − 1) ∗ (𝑐 − 1)
where r is the number of populations, and c is the number of levels for the
categorical variable.
𝐸𝑟,𝑐 = (𝑛 𝑟 ∗ 𝑛𝑐 ) / 𝑛
where Er,c is the expected frequency count for population r at level c of the
categorical variable, nr is the total number of observations from population r, nc is
the total number of observations at treatment level c, and n is the total sample size.
• Test statistic. The test statistic is a chi-square random variable (Χ2) defined by
the following equation.
(𝑂𝑟,𝑐 − 𝐸𝑟,𝑐 )2
𝜒2 = Σ
𝐸𝑟,𝑐
where 𝑂𝑟,𝑐 is the observed frequency count in population r for level c of the
categorical variable, and 𝐸𝑟,𝑐 is the expected frequency count in population r for
level c of the categorical variable.
Interpret Results
If the sample findings are unlikely, given the null hypothesis, the researcher rejects
the null hypothesis. Typically, this involves comparing the P-value to the significance
level, and rejecting the null hypothesis when the P-value is less than the significance
level.
The Chi-Square Test of Homogeneity
This test is concerned with two or more samples, with only one criterion
variable. It is used to determine if two or more populations are homogeneous.
The chi-square of homogeneity is used when we compare significant
difference between two or more groups.
2 𝑁(𝑎𝑑−𝑏𝑐)2
𝜒 = 𝑘𝑙𝑚𝑛
𝑁 = grand total
Total
a b k
c d l
Total m n N
(𝑂𝑟,𝑐 − 𝐸𝑟,𝑐 )2
𝜒2 = Σ
𝐸𝑟,𝑐
Where:
Example:
To illustrate this, we can evaluate the attitude of sample of Lakas and Laban parties
on the issue of peace and order in Mindanao. To carry out such study, a separate random
sample of members of each party is drawn from the nationwide population of Lakas and
Laban and each individual in both samples responds to the scale. Scores are then
classified into “favorable”or “unfavorable” categories. The following frequencies are
obtained
I. Problem:
Is there a significant difference between the attitudes of the two political
parties on the issue of peace and order in Mindanao?
II. Hypotheses:
H1: There is significant difference between the attitudes of the two political
parties on the issue of peace and order in Mindanao.
α = .05
𝑑𝑓 = (𝑟 − 1) ∗ (𝑐 − 1)
c= column r=row
𝑑𝑓 = (2 − 1) ∗ (2 − 1)
𝑑𝑓 = 1
𝑁(𝑎𝑑−𝑏𝑐)2
𝜒2 = 𝑘𝑙𝑚𝑛
200[(65)(50)−(35)(50)]2
= (100)(100)(115)(85)
450000000
𝜒2 = = 4.604
97750000
V. Decision Rule: If the chi-square computed value is greater than the tabulated
value, disconfirm null hypothesis.
This means that there is significant difference between the attitudes of the
two political parties on the issue of peace and order in Mindanao.
Problem
Viewing Preferences
Total
Lone Ranger Sesame Street The Simpsons
Boys 50 30 20 100
Girls 50 80 70 200
Total 100 110 90 300
Do the boys' preferences for these TV programs differ significantly from the girls'
preferences? Use a 0.05 level of significance.
Solution
The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an
analysis plan, (3) analyze sample data, and (4) interpret results. We work through those
steps below:
• State the hypotheses. The first step is to state the null hypothesis and an
alternative hypothesis.
o Null hypothesis: The null hypothesis states that the proportion of boys who
prefer the Lone Ranger is identical to the proportion of girls. Similarly, for
the other programs. Thus,
𝑑𝑓 = (𝑟 − 1) ∗ (𝑐 − 1)
𝑑𝑓 = (r - 1) * (c - 1) = (2 - 1) * (3 - 1) = 2
𝐸𝑟,𝑐 = (𝑛 𝑟 ∗ 𝑛𝑐 ) / 𝑛
(𝑂𝑟,𝑐 − 𝐸𝑟,𝑐 )2
𝜒2 = Σ
𝐸𝑟,𝑐
We use the Chi-Square Distribution Calculator to find P(𝜒 2 > 19.39) = 0.0000. (The
actual P-value, of course, is not exactly zero. If the Chi-Square Distribution
Calculator reported more than four decimal places, we would find that the actual
P-value is a very small number that is less than 0.00005 and greater than zero.)
• Interpret results. Since the P-value (0.0000) is less than the significance level
(0.05), we reject the null hypothesis.
References:
https://stattrek.com/chi-square-test/homogeneity.aspx?tutorial=AP