Baby chicks are pecking at grains of craked corn of different colors. A researchers is attempting to determine if they have a preference for one color over another. He counts the number of grains chosen in an arena that has equal number of red, blue, green and yellow corn chunks. Here are his results:

Red : 250, Blue : 220, Green : 230, Yellow : 240.

Use chi-square analysis to test whether the baby chicks have a preference.

Solution

The observed data is

Color Obs. Freq.$(O)$ Prop.
Red 250 0.25
Blue 220 0.25
Green 230 0.25
Yellow 240 0.25

Step 1 The null and alternative hypothesis are as follows:

$H_0:$ Baby chicks have no preference for one color over the other,

i.e., $H_0: p_1=p_2=p_3=p_4 = \frac{1}{4}=0.25$

$H_1:$ Baby chicks have preference for one color over the other.

Step 2 Test statistic

The test statistic for testing above hypothesis is

$$ \begin{equation*} \chi^2= \sum \frac{(O_{i} -E_{i})^2}{E_{i}} \sim \chi^2_{(k-1)} \end{equation*} $$

Step 3 Level of Significance

The level of significance is $\alpha =0.05$.

Step 4 Critical value of $\chi^2$

The level of significance is $\alpha =0.05$. Degrees of freedom $df=k-1=4-1 =3$.

The critical value of $\chi^2$ for $df=3$ and $\alpha=0.05$ level of significance is $\chi^2 =7.8147$.

Step 5 Test Statistic

The expected frequencies can be calculated as

$$ \begin{equation*} E_{i} =N*p_i \end{equation*} $$

For example, $E_{1}$ is given by

$$ \begin{eqnarray*} E_{1} & = &N*p_1\\ &=& 940*0.25\\ &=&235. \end{eqnarray*} $$

Color Obs. Freq.$(O)$ Prop. $p_i$ Expe.Freq.$(E)$ $(O-E)^2/E$
Red 250 0.25 235 0.957
Blue 220 0.25 235 0.957
Green 230 0.25 235 0.106
Yellow 240 0.25 235 0.106

The test statistic is

$$ \begin{eqnarray*} \chi^2&=& \sum \frac{(O_{i} -E_{i})^2}{E_{i}} \sim \chi^2_{(k-1)}\\ &=&\frac{(250-235)^2}{235}+\cdots + \frac{(240-235)^2}{235}\\ &=& 0.957 +\cdots + 0.106\\ &=& 2.126. \end{eqnarray*} $$

Step 6 Decision (Traditional approach)

The test statistic is $\chi^2 =2.126$ which falls $outside$ the critical region bounded by the critical value $7.8147$, we $\textit{fail to reject}$ the null hypothesis.

OR

Step 6 Decision ($p$-value approach)

The p-value is $P(\chi^2_{3}>2.126) =0.54667$.

As the p-value $0.5467$ is $\textit{greater than}$ the significance level of $\alpha = 0.05$, we $\textit{fail to reject}$ the null hypothesis.

There is no sufficient evidence to support the alternative hypothesis. That is Baby chicks have no preference for one color over the other.

Further Reading