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 234For each, we test the hypotheses thatH 0 :µ 1 =µ 2 , H A :µ 1 pre = c(77, 56, 64, 60, 57, 53, 72, 62, 65, 66)> post = c(88, 74, 83, 68, 58, 50, 67, 64, 74, 60)> boxplot(pre,post)> t.test(pre, post,var.equal=TRUE, alt="less")...t = −1.248, df = 18, p-value = 0.1139The p-value is small but not significant.If we assume these scores are paired off, then we focus on the differences. This gives amuch smaller p-value> t.test(pre,post, paired=TRUE, alt="less")...t = −1.890, df = 9, p-value = 0.04564...This time, the difference is significant at the 0.05 level.If small samples are to be used, it can often be advantageous to use paired samples,rather than independent samples.8.6.3 The Wilcoxon rank-sum test <strong>for</strong> equality of centerThe two-sample t-test tests whether two independent samples have the same center whenboth samples are drawn from a normal distribution. However, there are many situationsin which the parent populations may be heavily skewed or have heavy tails. Then the t-test is not appropriate. However, if it is assumed that our two samples come from twodistributions that are identical up a shift of center, then the Wilcoxon rank-sum test canbe used to per<strong>for</strong>m a significance test to test whether the centers are identical.

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

Saved successfully!

Ooh no, something went wrong!