Table of Contents

Chi Squared Test


Sunday, 2 January 2022
2-minute read
301 words

Hypotheses

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

BrownBlueOrangeGreenRedYellowTotal
Observed $O$1691174855
Expected $E$7131197855
Difference $(O-E)$81160490N/A
Difference Squared $(O-E)^2$81160490N/A
$\frac{(O-E)^2}{E}$11.61.200.41.30$\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.