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 216For a normally distributed population, T has the t-distribution with n−1 degrees offreedom under H 0 . For large n, T has the standard normal distribution. Letbybe the observed value of the test statistic. The p-value is computedIn R, the function t.test () can be used to compute the p-value with unsummarizeddata, as int.test (x, mu=…, alt=“two.sided”)The null hypothesis is specified by a value <strong>for</strong> the argument mu=. The alternative isspecified as appropriate by alt=“less”, alt=“greater”, or alt=“two. sided” (the default).■ Example 8.4: SUV gas mileage A consumer group wishes to see whether the actualmileage of a new SUV matches the advertised 17 miles per gallon. The group suspects itis lower. To test the claim, the group fills the SUV’s tankTable 8.2 SUV gas mileagestem leaf11 41213 114 7715 056916 08and records the mileage. This is repeated ten times. The results are presented in a stemand-leafdiagram in Table 8.2.Does this data support the null hypothesis that the mileage is 17 or the alternative, thatit is less?The data is assumed to be normal, and the stem-and-leaf plot shows no reason to doubtthis. The null and alternative hypotheses areH 0 :µ=17, H A :µ

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

Saved successfully!

Ooh no, something went wrong!