I'm trying to run a t-test using t.test()
but am confused about the p-value and confidence interval. Looking at the output I see a p-value of ~0.03. That leads me to believe I'd reject the null hypothesis at a 95% level. However, when I compare the difference in my means, 0.25, is solidly within the 95% confidence interval shown. With a small p-value I thought it would be outside, but I'm new to this whole process. How do I reconcile a small p-value with a difference within the confidence interval? Is the difference in mean not what the confidence interval shows?
> t.test(childs ~ vet, data = cols)
data: childs by vet
t = 2.163, df = 130.97, p-value = 0.03236
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.02163258 0.48494263
sample estimates:
mean in group FALSE mean in group TRUE
2.707134 2.453846
> 2.707 - 2.4538
[1] 0.2532