10.07.2015 Views

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Multivariate data 131+ subset=(wt != 999 & gestation != 999),+ panel=panel.regression) # a new panel functionFigure 4.8 contains the graphic. We might ask, “Are the slopes similar?” and, “Whatwould it mean if they aren’t?”Figure 4.8 Gestation versus weight<strong>for</strong> levels of smoke4.4.1 Problems4.22 The kid. weights (<strong>Using</strong>R) data set contains measurements <strong>for</strong> several children.There is a clear relationship between height and weight. Break the data down by the ageof the child. As age is numeric, it helps to turn it into a factor: cut (age/12, 3*(0:4)). Doyou see the same trend <strong>for</strong> all the age groups?4.23 For the kid.weights (<strong>Using</strong>R) data set, explore the relationship of weight andgender <strong>for</strong> the age ranges 0–3, 3–6, 6–9, and 9–12. Is the relationship always the same?4.24 The female. inc (<strong>Using</strong>R) data set contains income and race data <strong>for</strong> females inthe United States <strong>for</strong> the year 2001. Make a boxplot of the income variable broken up bythe race variable. Do there appear to be any major differences among the races? Inaddition, compute the summary statistics <strong>for</strong> each racial group in the data.4.25 The data set ToothGrowth contains measurements of tooth growth <strong>for</strong> differentdosages of a supplement. Use the function bwplot() to make boxplots of len <strong>for</strong> each levelof dose broken up by the levels of supp. You need to make dose a factor first. Also,repeat the graphic after reversing the role of the two factors.4.26 The car safety (<strong>Using</strong>R) data set contains data on accident fatalities per millionvehicles <strong>for</strong> several types of cars. Make boxplots of Driver. deaths broken down by type.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!