A paired *t*-test can be run on a variable that was measured twice for each sample subject to test if the mean difference in measurements is significantly different from zero. For example, consider a sample of people who were given a pre-test measuring their knowledge of a topic. Then, they were given a video presentation about the topic, and were tested again afterwards with a post-test:

Sample Subject | Pre-Test Score | Post-Test Score | Difference |

1 | 10 | 18 | 8 |

2 | 14 | 12 | -2 |

3 | 15 | 15 | 0 |

… |

A paired *t*-test can determine if the mean of the pre-test scores is significantly different than the mean of their post-test scores by testing if the **mean difference** in scores for these subjects was different from zero. Although the paired *t*-test is considered a “two-sample” *t-*test, it is actually the same as running a one-sample *t*-test on the differences.

**Hypotheses:**

*H*_{o}: The difference in population means equals zero, or μ_{d} = 0

*H*_{A}: The difference in population means does not equal zero, or μ_{d} ≠ 0

This test can also be conducted with a directional alternate hypothesis such as:

*H*_{o}: The difference in population means equals zero, or μ_{d} = 0

*H*_{a}: The difference in population means is greater than zero, or μ_{d} > 0

**Relevant equations:**

Degrees of freedom: number of pairs – 1

The test statistic (where *dbar* is the sample mean difference and *SE* is the estimated standard error of the differences):

For more information on how to calculate the sample mean and standard deviation, see this page.

**Assumptions:**

- Random samples
- Independent observations
- The differences are normally distributed.

If the third assumption is violated, an alternative test is the ** Sign Test**, which tests if the

**median**difference significantly differs from zero.

**Example 1: Hand calculation video**

This example uses a paired *t*-test to determine if drinking coffee significantly increases blood pressure.

*t*(

*df*=5)=2.71, which is greater than our critical value of 2.02, we have evidence to suggest that drinking coffee does increase blood pressure.

**Example 2: How to run in Excel 2016 on**

Some of this analysis requires you to have the add-in Data Analysis ToolPak in Excel enabled.

In this tutorial you will determine if students performed differently on the pre- versus post-stats test.

Dataset used in video

PDF directions corresponding to video

*t*(

*df*=68)=4.17,

*p<*.001, we have evidence to suggest that students do better on average on the post-test of statistics than they did on the pre-test, with a 95% CI [.68, 1.93].

**Example 3: How to run in RStudio**

This example tests if there was change in how likely (on a scale of 1-10) students felt they would be in an exclusive relationship at the end of the year from the beginning of the semester compared to at the end.

Dataset used in video

R script file used in video

*t*(

*df*=213)=3.22 and

*p*<0.05, our data provides evidence that the mean likelihood of students being in an exclusive relationship did change from the beginning of the semester to the end.