################################################################################ ### Comparing two samples using t-test ################################################################################ A.acc = c(0.853, 0.859, 0.863, 0.871, 0.832, 0.848, 0.863, 0.860, 0.850, 0.849) mean(A.acc) # [1] 0.8548 B.acc = c(0.851, 0.848, 0.862, 0.871, 0.835, 0.836, 0.860, 0.859, 0.841, 0.843) mean(B.acc) # [1] 0.8506 ### Overlapping confidence intervals t.test(A.acc, mu = 0.8506) One Sample t-test data: A.acc t = 1.2195, df = 9, p-value = 0.2537 alternative hypothesis: true mean is not equal to 0.8506 95 percent confidence interval: 0.8470088 0.8625912 sample estimates: mean of x 0.8548 t.test(B.acc, mu = 0.8548) One Sample t-test data: B.acc t = -1.0974, df = 9, p-value = 0.301 alternative hypothesis: true mean is not equal to 0.8548 95 percent confidence interval: 0.8419418 0.8592582 sample estimates: mean of x 0.8506 ### Paired t-test t.test(A.acc, B.acc, paired=T) Paired t-test data: A.acc and B.acc t = 2.6296, df = 9, p-value = 0.02738 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.0005868378 0.0078131622 sample estimates: mean of the differences 0.0042 # Explanation -- the same thing using one-sample t-test t.test(A.acc - B.acc) One Sample t-test data: A.acc - B.acc t = 2.6296, df = 9, p-value = 0.02738 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 0.0005868378 0.0078131622 sample estimates: mean of x 0.0042