The \(\chi^2\) Distribution
Understand the chi-squared distribution, its properties, and how it powers goodness-of-fit and independence tests in statistics.
What is the \(\chi^2\) Distribution?
The chi-squared distribution arises when you sum the squares of independent standard normal random variables. If \( Z_1, Z_2, \ldots, Z_k \) are independent with \( Z_i \sim N(0,1) \), then:
It is a continuous, non-negative distribution used extensively in hypothesis testing: goodness-of-fit tests, tests for independence, and homogeneity tests.
Shape Depends on Degrees of Freedom
Key Properties of \(\chi^2(k)\)
The distribution is always right-skewed, but the skewness decreases as the degrees of freedom increase: \(\text{skewness} = \sqrt{8/k}\).
The \(\chi^2\) Test Statistic
In hypothesis testing, we compute a test statistic that measures the discrepancy between observed and expected frequencies:
Under \(H_0\), this statistic approximately follows a \(\chi^2\) distribution. A large value of \(\chi^2_{\text{calc}}\) means the data deviate significantly from expectation.
GoF vs Independence Tests
| Goodness-of-Fit | Test for Independence | |
|---|---|---|
| Purpose | Does a single variable fit a claimed distribution? | Are two categorical variables independent? |
| Data | One row of observed counts | Contingency table (rows × columns) |
| Degrees of freedom | \( k - 1 \) | \( (r-1)(c-1) \) |
| \( H_0 \) | Data follows the proposed distribution | The two variables are independent |
| Expected freq. | \( f_e = n \cdot p_i \) | \( f_e = \frac{\text{row total} \times \text{col total}}{n} \) |
Understanding Degrees of Freedom
Degrees of freedom (df) represent the number of values that are free to vary once constraints are applied. They determine which \(\chi^2\) curve to use for critical values.
where \(k\) = number of categories
where \(r\) = rows, \(c\) = columns
The Critical Region
The shaded region shows where we would reject \(H_0\) at significance level \(\alpha\). The critical value \(\chi^2_{\text{crit}}\) is read from tables or a GDC using df and \(\alpha\).
How to Conduct a \(\chi^2\) Test
Example 1: Goodness-of-Fit
A die is rolled 60 times. The results are shown below. Test at the 5% significance level whether the die is fair.
| Face | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| \(f_o\) | 14 | 8 | 12 | 15 | 5 | 6 |
| \(f_e\) | 10 | 10 | 10 | 10 | 10 | 10 |
Example 1: Calculation
Example 2: Test for Independence
A survey of 200 students asked about their preferred study method and exam result. Test at \(\alpha = 0.05\) whether the variables are independent.
| Pass | Fail | Total | |
|---|---|---|---|
| Visual | 48 | 12 | 60 |
| Auditory | 56 | 24 | 80 |
| Kinesthetic | 36 | 24 | 60 |
| Total | 140 | 60 | 200 |
Example 2: Expected Values and Result
Example 3: When We Reject \(H_0\)
A biologist claims that flower colour in a species follows a \(3:1\) ratio (red : white). In a sample of 200 flowers, 130 are red and 70 are white. Test at \(\alpha = 0.05\).
Common Mistakes to Avoid
Summary Reference Card
| Concept | Formula / Rule |
|---|---|
| Test statistic | \(\chi^2_{\text{calc}} = \sum \frac{(f_o - f_e)^2}{f_e}\) |
| Mean | \(E(X) = k\) |
| Variance | \(\text{Var}(X) = 2k\) |
| GoF \(\text{df}\) | \(k - 1\) |
| Independence \(\text{df}\) | \((r-1)(c-1)\) |
| Expected (GoF) | \(f_e = n \cdot p_i\) |
| Expected (Ind.) | \(f_e = \frac{\text{row} \times \text{col}}{n}\) |
| Condition | All \(f_e \ge 5\) |
| Decision | Reject \(H_0\) if \(\chi^2_{\text{calc}} > \chi^2_{\text{crit}}\) |
Question 1 of 5
If \(X \sim \chi^2(8)\), what are the mean and variance of \(X\)?
Question 2 of 5
A goodness-of-fit test has 4 categories. What are the degrees of freedom?
Question 3 of 5
In a \(\chi^2\) test, \(\chi^2_{\text{calc}} = 12.4\) and \(\chi^2_{\text{crit}} = 9.49\) at \(\alpha = 0.05\). What is the conclusion?
Question 4 of 5
A \(3 \times 3\) contingency table is used for a test of independence. What are the degrees of freedom?
Question 5 of 5
Which condition must be met before conducting a \(\chi^2\) test?