CHAPTER 12

image

Analysis of Variance

So far, we have explored hypothesis tests that cope with at most two samples. Now, of course, they could be run multiple times—it would be trivial to extend loops and t.test to run through many iterations. However, that is a proposition fraught with risk. For a given = 0.05, suppose we wish to compare mean staph infection rates for eight regional medical centers. Then there are choose(8,2) = 28 total pairwise comparisons. Thus, the chance of at least one Type I error, supposing our eight samples are independent, is 1 – (.95)28 = 0.7621731 which is rather high. Analysis of variance (ANOVA) compares three or more ...

Get Beginning R: An Introduction to Statistical Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.