Jesus A. Gonzalez
February 16, 2020
*http://www.statstutor.ac.uk/resources/uploaded/paired-t-test.pdf*
a = c(12.9, 13.5, 12.8, 15.6, 17.2, 19.2, 12.6, 15.3, 14.4, 11.3)
b = c(12.7, 13.6, 12.0, 15.2, 16.8, 20.0, 12.0, 15.9, 16.0, 11.1)
ttest <- t.test(a,b, paired=TRUE)
ttest
##
## Paired t-test
##
## data: a and b
## t = -0.21331, df = 9, p-value = 0.8358
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.5802549 0.4802549
## sample estimates:
## mean of the differences
## -0.05
qt(0.975, 9)
## [1] 2.262157
a = c(12.9, 13.5, 12.8, 15.6, 17.2, 19.2, 12.6, 15.3, 14.4, 11.3)
b = c(12.0, 12.2, 11.2, 13.0, 15.0, 15.8, 12.2, 13.4, 12.9, 11.0)
ttest <- t.test(a,b, paired=TRUE, alt="less")
ttest
##
## Paired t-test
##
## data: a and b
## t = 5.2671, df = 9, p-value = 0.9997
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
## -Inf 2.170325
## sample estimates:
## mean of the differences
## 1.61
a = c(12.9, 13.5, 12.8, 15.6, 17.2, 19.2, 12.6, 15.3, 14.4, 11.3)
b = c(12.0, 12.2, 11.2, 13.0, 15.0, 15.8, 12.2, 13.4, 12.9, 11.0)
ttest <- t.test(a,b, paired=TRUE, alt="greater")
ttest
##
## Paired t-test
##
## data: a and b
## t = 5.2671, df = 9, p-value = 0.0002579
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 1.049675 Inf
## sample estimates:
## mean of the differences
## 1.61