Chi Square Test
Name: Bilal Mehadi
Roll No: 247560
Degree: M phil Botany
Semester: 2nd Evening
Teacher Dr. Irfan
Government College University,
Introduction
The Chi-Square (χ²) test is a statistical
method used to examine the relationship
between categorical variables.
It compares observed data with data we
would expect to obtain according to a
specific hypothesis.
Formula Chi-Square Formula:
χ² = Σ [(Oᵢ – Eᵢ)² / Eᵢ]
Where:
•O = Observed frequency
•E = Expected frequency
•Σ = Summation over all
categories
Chi-Square Formula:
χ² = Σ [(Oᵢ – Eᵢ)² / Eᵢ]
Where:
•O = Observed frequency
•E = Expected frequency
•Σ = Summation over all
categories
The X2
statistic
Both of Pearson’s chi-square tests use the same formula to
calculate the chi-square (X ) statistic
2
Where:
X2 is the chi-square statistic
Σ is the summation operator
(i.e., it “takes the sum of”)
O is the observed frequency
E is the expected frequency
The larger the difference between the observations and
expectations (O – E in the equation), the bigger the chi-
square statistic will be.
The chi-square statistic gets compared with a critical
value using a chi-square critical value table or
statistical software.
Example – Test of
Independence
Gend
Likes Ice Cream Doesn’t Like Total
er
Male 30 10 40
Fema
20 20 40
le
Total 50 30 80
•Null Hypothesis (H₀): Gender and preference
are independent
•Calculate expected values and χ²
•Compare with critical value from table
Types of Chi-Square
Test
[Link]-Square Test of Independence
[Link] to determine whether two categorical variables
are related or independent.
[Link]: Is there an association between gender and
food preference
[Link]-Square Goodness-of-Fit Test
[Link] whether observed frequencies match expected
frequencies for a single categorical variable.
[Link]: Do dice rolls follow a uniform distribution
⚠️Error Analysis in Chi-
Square Test
[Link] I Error (False Positive):
•Rejecting a true null hypothesis.
•Solution: Use correct significance level (usually α =
0.05)
2. Type II Error (False Negative):
•Failing to reject a false null hypothesis.
•Solution: Ensure sufficient sample size and
expected frequency ≥ 5
Interpretatio
n
•If χ² calculated > χ² critical → Reject H₀
•If χ² calculated ≤ χ² critical → Fail to
reject H₀
•The p-value also helps determine
significance
Importance of Chi-
Square Test
Simple and widely used
No assumption of normality
Useful in social sciences, marketing, genetics
Handles large samples effectively
Applications of Chi-
Square Test
•Medical Research: Checking the association between
drug and recovery rate
•Market Research: Understanding customer
preferences based on age/gender
•Education: Relation between study method and
performance
•Genetics: Validating Mendelian ratios
•Sociology: Comparing population responses in
Conclusio
n
The Chi-Square test is a powerful tool for testing
relationships in categorical data.
It is simple, widely used, and easy to interpret with
correct assumptions.
Presented by:
Bilal