In R-Commander, click Data → Data in pacakges → Read data set from an attached package, then select the HairEyeColor data from the datasets package. The data include hair and eye color and sex for 592 statistics students at the University of Delaware reported by Snee (1974). The first column shows different hair colors (Black, Brown, Red, Blond), the second column shows different eye colors (Brown, Blue, Hazel, Green), and the third column shows genders (Male, Female) of students. For each row, the last column shows the number of students with a specific hair color, eye color, and gender.
(a) Use Pearson’s χ 2 test to evaluate the null hypothesis that different hair colors have equal probabilities. Use Pearson’s χ 2 test to evaluate the null hypothesis that different eye colors have equal probabilities.
(b) Create a 4×4 contingency table where the rows represent different hair colors and the columns represent different eye colors. Is there a relationship between hair color and eye color?
(c) Enter the contingency table in R-Commander and use Chi-square test of independence to evaluate the relationship between hair color and eye color.