A Chi-squared test (
Note that Chi (
) is pronounced as the "ki" in "kite"
The Chi-squared test can be applied in various scenarios, including
- Goodness-of-fit tests: To determine if an observed frequency distribution differs from a theoretical distribution.
- Tests of independence: To assess whether there is a significant association between two categorical variables.
We test the test statistic against the chi-squared distribution. Since the
Goodness of Fit Test
The Chi-squared goodness-of-fit test has the null hypothesis
It has the following assumptions:
- observations are independent
- the expected frequencies don’t have empty and no more than 20% are < 5 (Cochran’s rule)
For a test with
where
The degrees of freedom is
Test for Independence
The chi-squared test for independence has the null hypothesis
Sleep during lecture | Not sleep | Total | |
---|---|---|---|
like class | 20 | 40 | 60 |
dislike class | 20 | 20 | 40 |
Total | 40 | 60 | 100 |
The test statistic is similar to the goodness of fit test too. If you have
The degrees of freedom for the
Interesting Fact
Ronald Fisher used the