HairEyeColor            package:datasets            R Documentation

_H_a_i_r _a_n_d _E_y_e _C_o_l_o_r _o_f _S_t_a_t_i_s_t_i_c_s _S_t_u_d_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Distribution of hair and eye color and sex in 592 statistics
     students.

_U_s_a_g_e:

     HairEyeColor

_F_o_r_m_a_t:

     A 3-dimensional array resulting from cross-tabulating 592
     observations on 3 variables.  The variables and their levels are
     as follows:

       No  Name  Levels
        1  Hair  Black, Brown, Red, Blond
        2  Eye   Brown, Blue, Hazel, Green
        3  Sex   Male, Female

_D_e_t_a_i_l_s:

     The Hair x Eye table comes rom a survey of students at the
     University of Delaware reported by Snee (1974).  The split by
     'Sex' was added by Friendly (1992a) for didactic purposes.

     This data set is useful for illustrating various techniques for
     the analysis of contingency tables, such as the standard
     chi-squared test or, more generally, log-linear modelling, and
     graphical methods such as mosaic plots, sieve diagrams or
     association plots.

_S_o_u_r_c_e:

     <URL:
     http://euclid.psych.yorku.ca/ftp/sas/vcd/catdata/haireye.sas>

     Snee (1974) gives the two-way table aggregated over 'Sex'.  The
     Sex split of the 'Brown hair, Brown eye' cell was changed in R
     2.6.0 to agree with that used by Friendly (2000).

_R_e_f_e_r_e_n_c_e_s:

     Snee, R. D. (1974) Graphical display of two-way contingency
     tables. _The American Statistician_, *28*, 9-12.

     Friendly, M. (1992a) Graphical methods for categorical data. _SAS
     User Group International Conference Proceedings_, *17*, 190-200.
     <URL: http://www.math.yorku.ca/SCS/sugi/sugi17-paper.html>

     Friendly, M. (1992b) Mosaic displays for loglinear models.
     _Proceedings of the Statistical Graphics Section_, American
     Statistical Association, pp. 61-68. <URL:
     http://www.math.yorku.ca/SCS/Papers/asa92.html>

     Friendly, M. (2000) _Visualizing Categorical Data._ SAS Institute,
     ISBN 1-58025-660-0.

_S_e_e _A_l_s_o:

     'chisq.test', 'loglin', 'mosaicplot'

_E_x_a_m_p_l_e_s:

     require(graphics)
     ## Full mosaic
     mosaicplot(HairEyeColor)
     ## Aggregate over sex (as in Snee's original data)
     x <- apply(HairEyeColor, c(1, 2), sum)
     x
     mosaicplot(x, main = "Relation between hair and eye color")

