# Paired t-test means that the variances of the 2 samples are the same?

Do paired samples imply that they have the same variance?

## migrated from stackoverflow.comMay 20 at 16:05

This question came from our site for professional and enthusiast programmers.

• Could you clarify what you mean by "they"? Exactly what random variable are you comparing to another random variable? And exactly which t-test are you referring to (there are several)? – whuber May 20 at 16:08
• The paired t-test is really a test of the mean difference between the samples (such as the difference between 'before' and 'after' values), and the assumption in the test is that the differences are approximately normally distributed. This does not require nor imply that the two samples have the same variance. – Andrew Gustar May 20 at 16:13

## 3 Answers

Well consider the hypothesis for a paired T-test:

Where . In effect, you are actually taking the

which is the variance of difference, and not the variance of the two groups. That is to say

• Note you can use MathJax here. – TheSimpliFire May 20 at 19:40

To illustrate @AndrewGustar's Comment, suppose you want to explore the effect of a training method on the scores of subjects taking a particular kind of exam.

Without intervention, the exam scores are $$\mathsf{Norm}(\mu = 100, \sigma = 15).$$ The intervention changes scores of individual subjects differently, according to $$\mathsf{Norm}(10, 5).$$ We can model this situation for $$n = 20$$ subjects in R as follows:

set.seed(520)
x      = rnorm(20, 100, 15)    # scores before
effect = rnorm(20, 8, 5)       # training effect
y      = x + effect            # scores after


For these data, a paired t-test detects the training effect, rejecting the null hypothesis that the population mean is unchanged; the p-value is quite small.

t.test(y, x, pair=T)

Paired t-test

data:  y and x
t = 7.4702, df = 19, p-value = 4.566e-07
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
5.293207 9.413863
sample estimates:
mean of the differences
7.353535


In the population, the original scores have a standard deviation of $$15;$$ the training introduces additional variability so that the standard deviation after training is $$\sqrt{15^2 + 5^2} = 15.81.$$ In the simulated exam scores, before and after scores reflect this increase:

sd(x); sd(y)
 15.5792
 16.14094


The paired t-test is precisely equivalent to a one-sample t test on the differences:

t.test(effect)

One Sample t-test

data:  effect
t = 7.4702, df = 19, p-value = 4.566e-07
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
5.293207 9.413863
sample estimates:
mean of x
7.353535


Note: In a real experiment one would probably not want to use exactly the same exam before and after training, because that would confound the effect of training with the passage of time and familiarity with the exam. One could use two equivalent versions of the exam, A and B. Half of the subjects could take A before training and the other half would take B before training. (Then a two-sample t test could be used to check whether the sequencing of the versions matters.)

There's no need to assume the pair-members have the same variance as long as you work with the usual estimate of the standard error of the difference based off the standard deviation of the pair-differences.

[If you have some formula based on the correlation between them it might be possible there's been an (unnecessary) assumption made of equality, but I haven't seen it done that way.]