BanglayShikhi
← 🔲 Chi-square & Categorical Analysis

Chi-square independence

5 min

The chi-square test of independence checks whether two categorical variables are associated.

Why it matters

It is the standard test for questions like "is smoking related to lung disease?" when both are categories.

Key ideas

  • Data arranged in a contingency table
  • H0: the variables are independent
  • Expected count = row total × column total ÷ N
  • χ² = Σ (O − E)² ÷ E, df = (r − 1)(c − 1)
  • Needs mostly expected counts ≥ 5
  • Report Cramér's V

Real-life research example

Smoking (yes/no) vs respiratory symptoms (yes/no) in 200 adults.

When to use

  • Two categorical variables, independent observations

When NOT to use

  • Don't use with small expected counts (use Fisher for 2×2)
  • Don't use on paired data

Mini example

Smokers: 30 with symptoms, 20 without; Non-smokers: 25 with, 125 without

Quick takeaway

Compare what you observe with what independence would predict.

Try it yourself

Enter the 2×2 counts above. Are smoking and symptoms associated? Check expected counts and Cramér's V.