Chi Squared Test
Sunday, 2 January 2022 | |
2-minute read | |
301 words | |
Hypotheses
- A hypothesis is a statement of the researcher’s idea or guess
- To test a hypothesis, the first thing to do is write a statement called the
null hypothesis
- The null hypothesis is often the opposite of the researcher’s guess
Example
Null hypothesis: *There is no difference between the average number of streams per square kilometer and the bedrock type.
Alternative hypotheses: *There is a difference between the average number of streams per square kilometer and the bedrock type.
Chi Squared Test $\chi$
$\chi^2 = \Sigma \frac{(O - E)^2}{E}$
$O =$ observed
$E =$ expected
Example
In a bag of 55 M&M’s, there are 16 browns, 9 blues, 11 oranges, 7 greens, 4 reds, and 8 yellows.
An unofficial report expects a bag of M&M’s to consist of 13% browns, 24% blues, 20% oranges, 16% greens, 13% reds, and 14% yellows.
Null hypothesis $H_0$: There is no significant difference between the color distribution of the M&M’s from the unofficial report and the actual color distribution of the M&M’s
Brown | Blue | Orange | Green | Red | Yellow | Total | |
---|---|---|---|---|---|---|---|
Observed $O$ | 16 | 9 | 11 | 7 | 4 | 8 | 55 |
Expected $E$ | 7 | 13 | 11 | 9 | 7 | 8 | 55 |
Difference $(O-E)$ | 81 | 16 | 0 | 4 | 9 | 0 | N/A |
Difference Squared $(O-E)^2$ | 81 | 16 | 0 | 4 | 9 | 0 | N/A |
$\frac{(O-E)^2}{E}$ | 11.6 | 1.2 | 0 | 0.4 | 1.3 | 0 | $\chi^2 = 14.5$ |
Now we calculate our degrees of freedom, which is the number of categories minus one = 5.
$\chi^2 = 14.5$, which is greater than the critical value $11.07$. This means the null hypothesis is rejected.
Alternative hypothesis $H_A$: There is a significant difference between the color distribution of the M&M’s from the unofficial report and the actual color distribution of the M&M’s
From this, we can conclude there are several other factors that may be affecting our color distribution.