Paired sample $t$ test

This page offers all the basic information you need about the paired sample $t$ test. It is part of Statkat’s wiki module, containing similarly structured info pages for many different statistical methods. The info pages give information about null and alternative hypotheses, assumptions, test statistics and confidence intervals, how to find p values, SPSS how-to’s and more.

To compare the paired sample $t$ test with other statistical methods, go to Statkat's or practice with the paired sample $t$ test at Statkat's

Contents

When to use?

Deciding which statistical method to use to analyze your data can be a challenging task. Whether a statistical method is appropriate for your data is partly determined by the measurement level of your variables. The paired sample $t$ test requires the following variable types:

Variable types required for the paired sample $t$ test :
Independent variable:
2 paired groups
Dependent variable:
One quantitative of interval or ratio level

Note that theoretically, it is always possible to 'downgrade' the measurement level of a variable. For instance, a test that can be performed on a variable of ordinal measurement level can also be performed on a variable of interval measurement level, in which case the interval variable is downgraded to an ordinal variable. However, downgrading the measurement level of variables is generally a bad idea since it means you are throwing away important information in your data (an exception is the downgrade from ratio to interval level, which is generally irrelevant in data analysis).

If you are not sure which method you should use, you might like the assistance of our method selection tool or our method selection table.

Null hypothesis

The paired sample $t$ test tests the following null hypothesis (H0):

H0: $\mu = \mu_0$

$\mu$ is the population mean of the difference scores; $\mu_0$ is the population mean of the difference scores according to the null hypothesis, which is usually 0. A difference score is the difference between the first score of a pair and the second score of a pair.
Alternative hypothesis

The paired sample $t$ test tests the above null hypothesis against the following alternative hypothesis (H1 or Ha):

H1 two sided: $\mu \neq \mu_0$
H1 right sided: $\mu > \mu_0$
H1 left sided: $\mu < \mu_0$
Assumptions

Statistical tests always make assumptions about the sampling procedure that's been used to obtain the sample data. So called parametric tests also make assumptions about how data are distributed in the population. Non-parametric tests are more 'robust' and make no or less strict assumptions about population distributions, but are generally less powerful. Violation of assumptions may render the outcome of statistical tests useless, although violation of some assumptions (e.g. independence assumptions) are generally more problematic than violation of other assumptions (e.g. normality assumptions in combination with large samples).

The paired sample $t$ test makes the following assumptions:

Test statistic

The paired sample $t$ test is based on the following test statistic:

$t = \dfrac{\bar{y} - \mu_0}{s / \sqrt{N}}$
$\bar{y}$ is the sample mean of the difference scores, $\mu_0$ is the population mean of the difference scores according to the null hypothesis, $s$ is the sample standard deviation of the difference scores, $N$ is the sample size (number of difference scores).

The denominator $s / \sqrt{N}$ is the standard error of the sampling distribution of $\bar{y}$. The $t$ value indicates how many standard errors $\bar{y}$ is removed from $\mu_0$.
Sampling distribution

Sampling distribution of $t$ if H0 were true:

$t$ distribution with $N - 1$ degrees of freedom
Significant?

This is how you find out if your test result is significant:

Two sided: Right sided: Left sided:
$C\%$ confidence interval for $\mu$

$\bar{y} \pm t^* \times \dfrac{s}{\sqrt{N}}$
where the critical value $t^*$ is the value under the $t_{N-1}$ distribution with the area $C / 100$ between $-t^*$ and $t^*$ (e.g. $t^*$ = 2.086 for a 95% confidence interval when df = 20)

The confidence interval for $\mu$ can also be used as significance test.
Effect size

Cohen's $d$:
Standardized difference between the sample mean of the difference scores and $\mu_0$: $$d = \frac{\bar{y} - \mu_0}{s}$$ Indicates how many standard deviations $s$ the sample mean of the difference scores $\bar{y}$ is removed from $\mu_0$
Visual representation

Paired sample t test
Equivalent to

The paired sample $t$ test is equivalent to:

Example context

The paired sample $t$ test could for instance be used to answer the question:

Is the average difference between the mental health scores before and after an intervention different from $\mu_0$ = 0?
SPSS

How to perform the paired sample $t$ test in SPSS:

Analyze > Compare Means > Paired-Samples T Test...
Jamovi

How to perform the paired sample $t$ test in jamovi:

T-Tests > Paired Samples T-Test