Paired Sample tTest
This online calculator performs tTest for the Significance of the Difference between the Means of Two Correlated Samples
This content is licensed under Creative Commons Attribution/ShareAlike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/7879/. Also, please do not modify any references to the original work (if any) contained in this content.
The calculator below implements paired sample ttest (also known as dependent samples ttest or ttest for correlated samples). ttest also known as Student's ttest, after pen name of William Sealy Gosset.
Paired samples ttests typically consist of a sample of matched pairs of similar units, or one group of units that has been tested twice (a "repeated measures" ttest).
A typical example of the repeated measures ttest would be where subjects are tested prior to a treatment, say for high blood pressure, and the same subjects are tested again after treatment with a bloodpressure lowering medication. By comparing the same patient's numbers before and after treatment, we are effectively using each patient as their own control. That way the correct rejection of the null hypothesis (here: of no difference made by the treatment) can become much more likely, with statistical power increasing simply because the random betweenpatient variation has now been eliminated. Note however that an increase of statistical power comes at a price: more tests are required, each subject having to be tested twice.
A paired samples ttest based on a "matchedpairs sample" results from an unpaired sample that is subsequently used to form a paired sample, by using additional variables that were measured along with the variable of interest. The matching is carried out by identifying pairs of values consisting of one observation from each of the two samples, where the pair is similar in terms of other measured variables. This approach is sometimes used in observational studies to reduce or eliminate the effects of confounding factors.^{1}
So, the test deals with correlated samples. This means that two sets of measures are arranged in pairs, where each item in one set is somehow linked with a corresponding item in another set. The idea is to replace difference between the means of two sets with the mean difference between the paired observations. This allows us to remove the extraneous effects of preexisting individual differences between subjects.
The null hypothesis here assumes that the true mean difference is equal to zero. The twotailed alternative hypothesis assumes that mean difference is not equal to zero. The uppertailed alternative hypothesis assumes that mean difference is greater than zero. The lowertailed alternative hypothesis assumes that mean difference is less than zero.
The test assumptions are:
 that the scale of measurement has the properties of an equalinterval scale.
 that the values have been randomly drawn from the source population.
 that the source population from which the values have been drawn can be reasonably supposed to have a normal distribution.
The procedure for the test is almost the same as the procedure for the Two sample tTest, with the only difference is that it operates on , which is equal to .

Calculate set of values as

Calculate the mean of the sample as
, where N is number of pairs (or number of values. 
Calculate sum of squared deviations of sum of squares as

Estimate the variance of the source population as

Estimate the standard deviation of the sampling distribution as
 Calculate t as
After we get tvalue, we can lookup the inverse of CDF of Student's tdistribution with degrees of freedom and estimate the confidence.
For details I can refer you to the excellent explanation here.
Comments