---
title: "Chi-square test of independence: 2×2 procedure"
subject: "Probability and Statistics"
chapter: 7
key: "semester_5/probability_and_statistics:chi-square-independence-2x2-procedure"
source: https://www.bctengineer.com/q/semester_5/probability_and_statistics/chi-square-independence-2x2-procedure
site: BCT Engineering
---

# Chi-square test of independence: 2×2 procedure

Probability and Statistics · Chapter 7: Inference concerning proportion

- Asked in: 2073 Shrawan, 5 marks
- Video: [Chi square formula for 2x2 contingency table](https://www.youtube.com/watch?v=CvUD_40alFM) — RB Online Tutorials
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/probability_and_statistics/chi-square-independence-2x2-procedure
- Whole chapter: https://www.bctengineer.com/md/semester_5/probability_and_statistics/chapter-7

## Question

Describe the Hypothesis testing procedure of Chi-square test of independence for 2×2 table.

## Short answer

State H₀: independence. Compute expected frequencies E = (row total × column total)/N. Compute χ² = Σ(O−E)²/E or N(ad−bc)²/[(a+b)(c+d)(a+c)(b+d)] with df=1. If any E<5, apply Yates' correction. Compare to critical χ² (e.g., 3.841 at 5%). Reject H₀ if calculated > critical.

## Answer

The chi-square test of independence checks whether two attributes (say A and B, each with two categories) are independent, using the frequencies in a 2 × 2 contingency table.

```text
          B1     B2     Total
A1        a      b      a+b
A2        c      d      c+d
Total     a+c    b+d    N
```

#### Procedure

1. **Hypotheses.**
   H0: attributes A and B are independent (no association).
   H1: A and B are not independent (associated).
2. **Level of significance** α, for example 0.05.
3. **Expected frequencies.** E = (row total × column total)/N for each cell, e.g. E₁₁ = (a+b)(a+c)/N.
4. **Test statistic.**

```text
χ² = Σ (O − E)²/E
```

   For a 2 × 2 table this also equals N(ad − bc)²/[(a+b)(c+d)(a+c)(b+d)]. With a small expected frequency (< 5), Yates' correction is applied: replace |O − E| by |O − E| − 0.5.
5. **Degrees of freedom** = (r − 1)(c − 1) = (2 − 1)(2 − 1) = 1.
6. **Critical value** χ²(α; 1) from the table: 3.841 at 5%, 6.635 at 1%.
7. **Decision.** If calculated χ² > critical value, reject H0 (the attributes are associated). Otherwise do not reject H0 (independent).
8. **Conclusion** in the words of the problem.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What do H0 and H1 state in a chi-square test of independence?
   A. H0: attributes are associated; H1: independent
   B. H0: attributes are independent; H1: associated
   C. H0: means are equal; H1: means differ
   D. H0: the sample is random; H1: it is not
   Answer: B. H0 is no association between A and B; H1 is that they are associated. (Key point: Hypotheses)

2. How many degrees of freedom does a 2 x 2 table have?
   A. 4
   B. 3
   C. 2
   D. 1
   Answer: D. (2 - 1)(2 - 1) = 1. (Key point: Degrees of freedom for 2 x 2)

3. When is Yates' correction applied in a 2 x 2 table?
   A. When any expected frequency is below 5
   B. When the sample size is very large
   C. When the table has more than two rows
   D. When H0 is rejected
   Answer: A. With small expected frequencies, |O - E| is replaced by |O - E| - 0.5. (Key point: Yates' correction)

4. At 5% the critical value is 3.841 with 1 d.f. If calculated chi-square is 5.2, what is the decision?
   A. Accept H0; attributes are independent
   B. Reject H0; attributes are associated
   C. Use 6.635 instead and accept H0
   D. No decision is possible
   Answer: B. 5.2 > 3.841, so H0 is rejected and the attributes are judged associated. (Key point: Decision rule)

## Related in Probability and Statistics

- [Hypothesis testing; difference of two proportions](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Ahypothesis-procedure-diff-two-proportions) — Probability and Statistics, chapter 7, asked 2×
- [Hypothesis testing steps; computer assemblies](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Asteps-hypothesis-testing-computers-readjust) — Probability and Statistics, chapter 7
- [Chi-square: brand-region association (1%)](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Achi-square-brand-region-1-percent) — Probability and Statistics, chapter 7, asked 4×
- [Chi-square goodness of fit: Poisson errors](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Achi-square-goodness-fit-poisson-pages) — Probability and Statistics, chapter 7, asked 2×
- [Chi-square: interest and computer ability](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Achi-square-interest-ability-computer) — Probability and Statistics, chapter 7
- [Chi-square distribution; brand-region association](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Achi-square-define-brand-region) — Probability and Statistics, chapter 7, asked 4×

## Related in other subjects

- [Chi-square uniformity test, 40 numbers](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Achi-square-uniformity-table-2074) — Simulation and Modeling, chapter 6
- [Chi-square test on 100 random numbers](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Achi-square-uniformity-100-numbers) — Simulation and Modeling, chapter 6
- [Soundness test of cement and procedure](https://www.bctengineer.com/question.md?key=semester_3%2Fcivil_engineering_materials%3Acement-soundness-test-procedure) — Civil Engineering Materials, chapter 5
- [Testing of DC machines: retardation vs Swinburne's test](https://www.bctengineer.com/question.md?key=semester_4%2Felectrical_machines_i%3Adc-testing-retardation-vs-swinburne) — Electrical Machines I, chapter 4
