T-test and Confidence Interval (CI)
The t-test is used to find out if two data sets are significantly different from each other. The t-test can be used to compare samples before and after a treatment or to compare two different ways of treatments in order to understand if a specific treatment can lead to significantly improvements.
The confidence interval describes the range that may contain the true difference between means of the two groups. It's usally given for a 95% specific reliability level. The confidence interval can be considered as an margin of error around the most likely value. In the same way as the p-value, a confidence interval can be used to show statistical significance (null hypothesis value included or not), but in addition it shows also the range of the tested difference value.
Example of t-test comparing two groups x and y
Welch Two Sample t-test
data: x and y
t = -3.4068, df = 15.045, p-value = 0.003889
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
mean of x mean of y
The p-value < 0.05 shows a strong evidence for a difference between data set x and y.
Instead of using the p-value, we can make the same conclusions using the confidence interval:
As the confidence interval of the true difference does not include 0, there is strong evidence that the means of x and y are different.
(95% CI and 0.05 p-value referring to the same significance level)
Welch's t-test: adjustment for differences in variance of the two groups. It corrects the number of degree of freedom (df).