Chi-Square Test: A Complete Guide with Examples & Formulas

Faculty Adda Team

Introduction to Chi-Square Tests

The chi-square test (χ²) is a powerful non-parametric statistical method used to analyze categorical data. Developed by Karl Pearson in the early 1900s, it helps determine whether observed frequencies differ significantly from expected frequencies.

(toc) #title=(Table of content)

How to Perform Chi-Square

This guide covers:
✔️ What is a chi-square test? Definition, history, and key concepts
✔️ Types of chi-square tests: Goodness-of-fit and test of independence
✔️ Assumptions: Random sampling, expected frequencies ≥5
✔️ Step-by-step examples with calculations and interpretations
✔️ When to use chi-square vs. parametric tests

(Keywords: "chi-square goodness of fit", "chi-square test of independence", "categorical data analysis")


1. What Is a Chi-Square Test?

The chi-square test is used when:

  • Data is categorical (e.g., gender, yes/no responses)

  • The population distribution is unknown or non-normal

  • You want to test relationships between variables or fit to a distribution

Key Concepts:

✅ Observed vs. Expected Frequencies: Compares actual data to theoretical predictions
✅ Degrees of Freedom (df): Depends on the number of categories (df = k - 1 for goodness-of-fit)
✅ Test Statistic (χ²): Measures how much observed data deviates from expected

Example:
A survey asks 100 people if they prefer tea or coffee. The chi-square test checks if the observed preferences (60 tea, 40 coffee) differ significantly from an expected 50-50 split.
🔹 Social Work Material – Essential guides and tools for practitioners.
🔹 Social Casework – Learn client-centered intervention techniques.
🔹 Social Group Work – Strategies for effective group facilitation.
🔹 Community Organization – Methods for empowering communities.


2. Types of Chi-Square Tests

2.1 Chi-Square Goodness-of-Fit Test

Purpose: Determine if sample data matches a hypothesized distribution.

Formula:

χ2=E(OE)2

χ2=(OE)2E

Where:

  • O

     = Observed frequency

  • E

     = Expected frequency

Example:

  • Observed: 60 tea drinkers, 40 coffee drinkers

  • Expected: 50 tea, 50 coffee (assuming no preference)

Calculation:

χ2=(6050)250+(4050)250=4

χ2=50(6050)2+50(4050)2=4

Conclusion: Compare to critical χ² value (df=1, α=0.05 → 3.84). Since 4 > 3.84, preferences are not 50-50.


2.2 Chi-Square Test of Independence

Purpose: Test if two categorical variables are related (e.g., gender and voting preference).

Formula:

χ2=(OE)2E

χ2=E(OE)2

Where expected frequencies are calculated as:

E=(Row Total)×(Column Total)Grand Total

E=Grand Total(Row Total)×(Column Total)

Example:

Right-HandedLeft-HandedTotal
Male22527
Female76480
Total989107

Expected Frequencies:

  • Male Right-Handed: 
    27×98107=24.73

  • Female Left-Handed: 
    80×9107=6.73

Result: χ² = 4.79 (df=1, critical value=3.84). Reject H₀ → Gender and handedness are related.


3. Key Assumptions

For accurate results, chi-square tests require:
✔️ Independent Samples: No overlap between groups.
✔️ Minimum Expected Frequencies: All expected counts ≥5 (for small samples, use Fisher’s exact test).
✔️ Categorical Data: Nominal or ordinal variables (e.g., yes/no, gender).

Violations? Use alternatives like Fisher’s exact test or G-test.


4. Step-by-Step Guide

Scenario: Does pet ownership (cat/dog) relate to income level (high/low)?

  1. Hypotheses:

    • H0

      H
      0
      : Pet ownership and income are independent.

    • H1

      H
      1
      : They are related.

  2. Collect Data:

    • Observed frequencies in a 2x2 table.

  3. Calculate Expected Frequencies:

    • Use row/column totals.

  4. Compute χ²:

    • Sum 
      (OE)2/E

  5. Compare to Critical Value:

    • df = (rows-1)(columns-1) = 1.

    • If χ² > 3.84 (α=0.05), reject H₀.


5. Common Mistakes

❌ Small Sample Sizes: Leads to unreliable expected frequencies.
❌ Ignoring Assumptions: Always check expected counts ≥5.
❌ Misinterpreting Results: χ² significance doesn’t imply causation.


Conclusion

The chi-square test is essential for analyzing categorical data, from market research to social sciences. By following assumptions and correctly interpreting results, you can uncover meaningful relationships in your data.

Need Help? Download our free [chi-square cheat sheet] or ask questions below!


FAQ Section

Q1: Can chi-square test be used for continuous data?

A: No—convert continuous data into categories (e.g., age groups) first.

Q2: What if expected frequencies are <5?

A: Use Fisher’s exact test or combine categories.

Q3: How to report chi-square results?

A: Format: χ²(df, N=sample size) = value, p = p-value (e.g., χ²(1, N=107) = 4.79, p = 0.029).

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top