The color vision of birds plays a role in their foraging behavior:

Birds use color to select and avoid certain types of food. The authors of the article "Colour Avoidance in Northern Bob whites :Effects of Age,Sex, and Previous Experience" (Animal Behaviour [1995]:519–526)studied the pecking behavior of one-day-old bob whites. In an area painted white, they inserted four pins with different colored beads. The color of the pin chosen on the bird’s first peck was noted for each of 33 bob whites, resulting in the following data:

Color Blue Green Yellow Red
First Peck Frequency 16 8 6 3

Do the data provide evidence of a color preference? Use $\alpha =0.05$.

Solution

The observed data is

Color Obs. Freq.$(O)$ Prop.
Blue 16 0.25
Green 8 0.25
Yellow 6 0.25
Red 3 0.25
Step 1 Setup the hypothesis

The null and alternative hypothesis are as follows:

$H_0:p_{1} =p_{2} =p_{3}=p_4=\frac{1}{4}$

$H_1:$ At least one of the proportion is different from $\frac{1}{4}$.

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$.

chi-square critical region
chi-square critical region

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\\ &=& 33*0.25\\ &=&8.25. \end{eqnarray*} $$

Color Obs. Freq.$(O)$ Prop. $p_i$ Expe.Freq.$(E)$ $(O-E)^2/E$
Blue 16 0.25 8.25 7.28
Green 8 0.25 8.25 0.008
Yellow 6 0.25 8.25 0.614
Red 3 0.25 8.25 3.341

The test statistic is

$$ \begin{eqnarray*} \chi^2&=& \sum \frac{(O_{i} -E_{i})^2}{E_{i}} \sim \chi^2_{(k-1)}\\ &=&\frac{(16-8.25)^2}{8.25}+\cdots + \frac{(3-8.25)^2}{8.25}\\ &=& 7.28 +\cdots + 3.341\\ &=& 11.243. \end{eqnarray*} $$

Step 6 Decision (Traditional approach)

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

OR

Step 6 Decision ($p$-value approach)

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

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

Thus we conclude that the data provide evidence of a color preference. That is at least one of the proportion is different from the expected proportion.

Further Reading