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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> R <strong>for</strong> introductory statistics 30211.1.3 <strong>Using</strong> aov() <strong>for</strong> ANOVAThe alternative aov() function will also per<strong>for</strong>m an analysis of variance. It returns amodel object similar to lm() but has different-looking outputs <strong>for</strong> the print() andsummary() extractor functions. These are analysis-of-variance tables that are typical ofother computer software and statistics books.Again, it is called with a model <strong>for</strong>mula, but with no specification of equal variances:> res = aov(values ~ ind, data = d)> res # uses print()Call:aov(<strong>for</strong>mula = values ~ ind, data = d)Terms:ind ResidualsSum of Squares 174664 586720Deg. of Freedom 2 12Residual standard error: 221.1Estimated effects may be unbalancedIt returns the two sums of squares calculated in Example 11.2 with their degrees offreedom. The Residual standard error, is found by the square root of RSS/(n−A;),which in this example is> sqrt(586720/12)[1] 221.1The result of aov() has more in<strong>for</strong>mation than shown, just as the result of lm() does. Forexample, the summary() function returns> summary(res)Df Sum Sq Mean Sq F value Pr(>F)ind 2 174664 87332 1.79 0.21Residuals 12 586720 48893These are the values needed to per<strong>for</strong>m the one-way test. This tabular layout is typical ofan analysis of variance.■ Example 11.3: Effect of grip on cross-country skiing Researchers at MontanaState University per<strong>for</strong>med a study on how various ski-pole grips affect cross-countryskiing per<strong>for</strong>mance. There are three basic grip types: classic, modern, and integrated. Foreach of the grip types, a skier has upper-body power output measured three times. Thedata is summarized in Table 11.1.Table 11.1 Upper-body power output (watts) byski-pole grip typeGrip type classic integrated modern168.2 166.7 160.1161.4 173.0 161.2

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

Saved successfully!

Ooh no, something went wrong!