220.127.116.11 Algorithms (Pair-Sample T-Test)
This function is used to test whether or not the difference of the two paired sample means equals to (i.e. to test whether or not their means are equal, you can just test whether or not their difference is 0, ). And the hypotheses take the form:
vs Two Tailed
vs Upper Tailed
vs Lower Tailed
Consider two samples and which assumed to be drawn from normal populations are equal size, we can define the paired difference as:
And we have the mean paired difference is:
Then we can compute the standard deviation for the difference between paired data points , with v = n-1 degrees of freedom as:
And then we can calculate the test statistic by:
Compare the t value with the critical value and we will reject if:
Two tailed test: ;
Upper tailed test: ;
Lower tailed test: ;
The p-value will also be compared with a user-defined significance level,,, which commonly 0.05 is used. And the null hypothesis will be rejected if .
The confidence interval for paired sample mean difference is:
The power of a two sample t-test is a measurement of its sensitivity. Detail algorithm about calculating power please read the help of Power and Sample Size.