Ch 18: Paired t-test
All students who enroll in a certain memory course are given a pretest before the course begins. A random sample of ten students who finished the course were given a pretest and their scoures are listed below.
ID | Before | After |
1 | 93 | 98 |
2 | 86 | 92 |
3 | 72 | 80 |
4 | 54 | 62 |
5 | 92 | 91 |
6 | 65 | 78 |
7 | 80 | 89 |
8 | 81 | 78 |
9 | 62 | 71 |
10 | 73 | 80 |
Paird t-test
Two-tail t-test of the difference between before and after.
Ho: the difference is equal to zero.
Ha: the difference is not equal to zero.> before <- c(93, 86, 72, 54, 92, 65, 80, 81, 62, 73) > after <- c(98, 92, 80, 62, 91, 78, 89, 78, 71, 80) > t.test(before, after, paired=T) Paired t-test data: before and after t = -4.0232, df = 9, p-value = 0.003004 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -9.529902 -2.670098 sample estimates: mean of the differences -6.1
[ Going back to Using R: Index ]