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.

Analysis of variance 307Repeat with an analysis of variance of the model Other. deaths ~ type. Is there adifference in population means?11.5 The data set hall. fame (<strong>Using</strong>R) contains statistics <strong>for</strong> several major leaguebaseball players. Per<strong>for</strong>m a one-way test to see whether the mean batting average, BA, isthe same <strong>for</strong> Hall of Fame members (Hall. Fame. Membership) as <strong>for</strong> other players.Table 11.3 Production of a chemicalLab 1 4.13 4.07 4.04 4.07 4.05Lab 2 3.86 3.85 4.08 4.11 4.08Lab 3 4.00 4.02 4.01 4.01 4.04Lab 4 3.88 3.89 3.91 3.96 3.9211.6 A manufacturer needs to outsource the production of a chemical. Be<strong>for</strong>e deciding ona laboratory, the manufacturer asks four laboratories to manufacture five batches each. Anumeric measurement is assigned to each batch. The data is given in Table 11.3. Per<strong>for</strong>ma one-way analysis of variance to see if there is a difference in the population means. Isthe data appropriate <strong>for</strong> oneway.test()? kruskal.test()?11.7 A manufacturer of point-of-sale merchandise tests three types of ENTERbuttonmarkings. They wish to minimize wear, as customers get annoyed when the markings onthis button wear off. They construct a test of the three types, and conduct several trials <strong>for</strong>each. The results, in unspecified units, are recorded in Table 11.4. Is there a difference inwear time among the three types? Answer this using a one-way ANOVA.Table 11.4 Wear times <strong>for</strong> point-of-sale testType 1 303 293 296 299 298Type 2 322 326 315 318 320 320Type 3 309 327 317 31511.8 Per<strong>for</strong>m a Kruskal-Wallis test on the data in the data set Plant Growth, where weightis modeled by the factor group. Is there a significant difference in the means?11.9 Per<strong>for</strong>m a one-way analysis of variance on the data in Example 11.4. Is there adifferent conclusion from the example?11.2 <strong>Using</strong> lm() <strong>for</strong> ANOVAThe mathematics behind analysis of variance is the same as that behind linear regression.Namely, it uses least-squares estimates based on a linear model. As such, it makes senseto unify the approaches. To do so requires a new idea in the linear model.To illustrate, we begin with an example comprising just two samples, to see how t-tests are handled with the lm() function.■ Example 11.5: ANOVA <strong>for</strong> two independent samplesSuppose we have two independent samples from normally distributed populations. LetX 11 , X 12 ,…,X 1n record the first and X 21 , X 22 , …, X 2n the second. Assume the population

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

Saved successfully!

Ooh no, something went wrong!