EVOLUTION-MANAGER
Edit File: HairEyeColor.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Hair and Eye Color of Statistics Students</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for HairEyeColor {datasets}"><tr><td>HairEyeColor {datasets}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Hair and Eye Color of Statistics Students</h2> <h3>Description</h3> <p>Distribution of hair and eye color and sex in 592 statistics students. </p> <h3>Usage</h3> <pre>HairEyeColor</pre> <h3>Format</h3> <p>A 3-dimensional array resulting from cross-tabulating 592 observations on 3 variables. The variables and their levels are as follows: </p> <table summary="Rd table"> <tr> <td style="text-align: right;"> No </td><td style="text-align: left;"> Name </td><td style="text-align: left;"> Levels </td> </tr> <tr> <td style="text-align: right;"> 1 </td><td style="text-align: left;"> Hair </td><td style="text-align: left;"> Black, Brown, Red, Blond </td> </tr> <tr> <td style="text-align: right;"> 2 </td><td style="text-align: left;"> Eye </td><td style="text-align: left;"> Brown, Blue, Hazel, Green </td> </tr> <tr> <td style="text-align: right;"> 3 </td><td style="text-align: left;"> Sex </td><td style="text-align: left;"> Male, Female </td> </tr> </table> <h3>Details</h3> <p>The Hair <i>x</i> Eye table comes rom a survey of students at the University of Delaware reported by Snee (1974). The split by <code>Sex</code> was added by Friendly (1992a) for didactic purposes. </p> <p>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. </p> <h3>Source</h3> <p><a href="http://euclid.psych.yorku.ca/ftp/sas/vcd/catdata/haireye.sas">http://euclid.psych.yorku.ca/ftp/sas/vcd/catdata/haireye.sas</a> </p> <p>Snee (1974) gives the two-way table aggregated over <code>Sex</code>. The <code>Sex</code> split of the ‘Brown hair, Brown eye’ cell was changed to agree with that used by Friendly (2000). </p> <h3>References</h3> <p>Snee, R. D. (1974). Graphical display of two-way contingency tables. <em>The American Statistician</em>, <b>28</b>, 9–12. doi: <a href="https://doi.org/10.2307/2683520">10.2307/2683520</a>. </p> <p>Friendly, M. (1992a). Graphical methods for categorical data. <em>SAS User Group International Conference Proceedings</em>, <b>17</b>, 190–200. <a href="http://www.math.yorku.ca/SCS/sugi/sugi17-paper.html">http://www.math.yorku.ca/SCS/sugi/sugi17-paper.html</a> </p> <p>Friendly, M. (1992b). Mosaic displays for loglinear models. <em>Proceedings of the Statistical Graphics Section</em>, American Statistical Association, pp. 61–68. <a href="http://www.math.yorku.ca/SCS/Papers/asa92.html">http://www.math.yorku.ca/SCS/Papers/asa92.html</a> </p> <p>Friendly, M. (2000). <em>Visualizing Categorical Data</em>. SAS Institute, ISBN 1-58025-660-0. </p> <h3>See Also</h3> <p><code><a href="../../stats/html/chisq.test.html">chisq.test</a></code>, <code><a href="../../stats/html/loglin.html">loglin</a></code>, <code><a href="../../graphics/html/mosaicplot.html">mosaicplot</a></code> </p> <h3>Examples</h3> <pre> 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") </pre> <hr /><div style="text-align: center;">[Package <em>datasets</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>