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.

Significance tests 231Figure 8.5 Densityplots to comparevariances and shapes of the 300 mgdosage (solid) and the 600 mg dosage(dashed)> t.test(x,y,var.equal=TRUE)Two Sample t-testdata: x and yt = −2.034, df = 18, p-value = 0.05696alternative hypothesis: true difference in means is notequal to 0...The p-value is 0.05696 <strong>for</strong> the two-sided test. This suggests a difference in the meanvalues, but it is not statistically significant at the 0.05 significance level. A look at thereported confidence interval <strong>for</strong> the difference of the means shows a wide range ofpossible value <strong>for</strong> µ x −µ y . We conclude that this data is consistent with the assumption ofno mean difference.How would this change if we did not assume equal variances?> t.test(x,y)Welch Two Sample t-testdata: x and yt = −2.034, df = 14.51, p-value = 0.06065alternative hypothesis: true difference in means is notequal to 095 percent confidence interval:−22.3557 0.5557sample estimates:mean of x mean of y289.4 300.3In this example, the same observed value of the test statistic (marked t) is found as in theequal-variance case, as (8.5) and (8.6) yield identical standard errors when the two

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

Saved successfully!

Ooh no, something went wrong!