

   HairEyeColor {base}                          R Documentation

   HHaaiirr aanndd EEyyee CCoolloorr ooff SSttaattiissttiiccss SSttuuddeennttss

   DDeessccrriippttiioonn::

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

   UUssaaggee::

        data(HairEyeColor)

   FFoorrmmaat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Deettaaiillss::

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

   RReeffeerreenncceess::

        Snee, R. D. (1974), Graphical display of two-way con-
        tingency tables.  The American Statistician, 28, 9-12.

        Friendly, M. (1992), Graphical Methods for Categorical
        Data.  SAS User Group International Conference Proceed-
        ings, 17, 190-200.  <URL: http://hot-
        spur.psych.yorku.ca/SCS/sugi/sugi17-paper.html>

        Friendly, M. (1992), Mosaic displays for loglinear mod-
        els.  Proceedings of the Statistical Graphics Section,
        61-68.  American Statistical Association.  <URL:
        http://hotspur.psych.yorku.ca/SCS/Papers/asa92.html>

   EExxaammpplleess::

        data(HairEyeColor)
        ## Full mosaic
        mosaicplot(HairEyeColor)
        ## Aggregate over sex:
        x <- apply(HairEyeColor, c(1, 2), sum)
        x
        mosaicplot(x, main = "Relation between hair and eye color")

