What Is a Paired Sample t-Test?

When researchers want to measure change, the paired sample t-test is one of the most reliable tools in their statistical arsenal. Whether you’re tracking patient blood pressure before and after a medication, comparing student scores before and after a tutoring program, or evaluating employee performance before and after training, this test is built for exactly that structure: two related measurements on the same subjects.

Unlike tests that compare two entirely separate groups, the paired sample t-test accounts for the natural connection between measurements, making it more sensitive to real differences. By focusing on the difference within each pair rather than between groups, it controls for individual variability that would otherwise obscure your results.

Struggling to find time for your assignment?

We write it for you: fast, reliable, and plagiarism-free

What Is a Paired Sample t-Test?

A paired sample t-test (also called a dependent samples t-test or repeated measures t-test) is a statistical test used to determine whether the mean difference between two related measurements is significantly different from zero. Rather than comparing two independent groups, it compares two measurements taken from the same subject — or from two subjects who have been deliberately matched on key characteristics.

The test works by computing the difference between each pair of observations, then asking a simple question: is the average of those differences large enough — relative to their variability — to conclude that a real effect exists, rather than random chance?

The Core Idea

Suppose you measure the resting heart rate of 20 participants before and after an eight-week exercise program. Each participant produces two data points: a pre-test score and a post-test score. Instead of treating these as two separate groups of 20, the paired t-test treats them as 20 individual differences:di=Xi,postXi,pred_i = X_{i,\text{post}} – X_{i,\text{pre}}

The test then evaluates whether the mean of those differences (dˉ\bar{d}dˉ) is statistically distinguishable from zero.

When Two Measurements Are “Paired”

Pairing occurs in two main research designs:

Repeated measures — The same subject is measured twice, typically before and after an intervention. This is the most common scenario. Examples include pre/post test scores, clinical measurements before and after treatment, or product ratings before and after a design change.

Matched pairs — Two different subjects are paired based on shared characteristics (age, weight, baseline score) to control for confounding variables. For example, pairing twins in a dietary study, or matching patients by severity of illness before assigning treatments.

In both cases, what defines a paired design is the meaningful, intentional link between each pair of observations — not just the fact that two measurements exist.

What the Test Produces

The paired sample t-test generates a t-statistic, which measures how many standard errors the observed mean difference sits away from zero. From the t-statistic, a p-value is derived, telling you the probability of observing a difference as large as yours — or larger — if the null hypothesis were true.

The test also produces a confidence interval for the mean difference, giving you a range of plausible values for the true population effect.

Paired vs. Independent Samples t-Test

A common point of confusion is deciding between a paired and an independent samples t-test. The distinction comes down to the relationship between observations:

FeaturePaired Samples t-TestIndependent Samples t-Test
SubjectsSame (or matched)Different, unrelated groups
Data structureOne row per pairOne row per subject
Controls for individual variabilityYesNo
Typical use casePre/post, matched pairsGroup A vs. Group B
Statistical powerHigher (when pairing is effective)Lower for same sample size

Choosing the wrong test — running an independent samples t-test on paired data — discards the correlation structure between measurements and reduces statistical power, making it harder to detect a real effect.

Assumptions of the Paired Sample t-Test

Assumption 1: Dependent Variable Is Continuous

The outcome variable must be measured on an interval or ratio scale — meaning the values are numeric, ordered, and the distances between them are consistent and meaningful.

  • Interval scale — Temperature in Celsius, IQ scores, calendar years. Equal spacing between values, but no true zero.
  • Ratio scale — Weight, height, reaction time, income. Equal spacing and a meaningful zero point.

This assumption is definitional: if your outcome is ordinal, binary, or categorical, the paired t-test is the wrong test. The mean difference is only interpretable when the underlying scale supports arithmetic operations.

Assumption 2: Observations Are Paired Meaningfully

Each observation in the first measurement must have one — and only one — corresponding observation in the second measurement. The pairing must reflect a genuine structural relationship, either because:

  • The same subject was measured twice, or
  • Two matched subjects were deliberately linked before data collection

This assumption is about study design, not something you can verify statistically after the fact. If pairings were not built into the data collection process, the paired t-test is not appropriate regardless of how the data are arranged.

Assumption 3: Independence of Pairs

While the two measurements within each pair are intentionally related, the pairs themselves must be independent of one another. The difference score for one subject should have no bearing on the difference score for another.

This assumption is violated when:

  • Subjects are clustered (e.g., students within the same classroom influencing each other)
  • Observations are repeated across more than two time points and treated as a single pair
  • Participants share an intervention in a way that creates social contagion effects

Independence is primarily a function of study design and sampling procedure. It cannot be tested statistically in the same way as normality, but it should be addressed in how participants were recruited and how the intervention was delivered.

Assumption 4: Normality of the Differences

The paired t-test requires that the difference scores (di=Xi,2Xi,1d_i = X_{i,2} – X_{i,1} are approximately normally distributed in the population. Importantly, this does not require the raw measurements themselves to be normal — only the differences.

How to assess normality:

Shapiro-Wilk test — The most widely recommended formal test for normality in small to moderate samples. A non-significant result (p > .05) supports the normality assumption.W=(i=1naid(i))2i=1n(didˉ)2W = \frac{\left(\sum_{i=1}^{n} a_i d_{(i)}\right)^2}{\sum_{i=1}^{n}(d_i – \bar{d})^2}

Histogram of differences — A quick visual check. Look for an approximately bell-shaped distribution without severe skewness or bimodality.

Q-Q plot (quantile-quantile plot) — Plots the quantiles of your difference scores against the theoretical quantiles of a normal distribution. Points falling close to the diagonal line indicate normality. Systematic curves or S-shapes indicate departures.

Formula for the Paired Sample t-Test

The paired sample t-test reduces a two-measurement problem to a one-sample problem by working entirely with the difference scores. Once you compute those differences, the test follows the same logic as a one-sample t-test asking whether the mean of a single variable equals zero.

Step 1: Compute the Difference Scores

For each subject iii, subtract the first measurement from the second:di=Xi,2Xi,1d_i = X_{i,2} – X_{i,1}

Where:

  • Xi,1X_{i,1}​ = the first measurement for subject iii (e.g., pre-test score)
  • Xi,2X_{i,2} = the second measurement for subject iii (e.g., post-test score)
  • did_i = the difference score for subject iii

The direction of subtraction is arbitrary but must be consistent across all subjects. Reversing it changes the sign of the t-statistic but not its magnitude or the p-value.

Step 2: Compute the Mean Difference

Calculate the arithmetic mean of the difference scores across all nnn pairs:dˉ=i=1ndin\bar{d} = \frac{\sum_{i=1}^{n} d_i}{n}

Where:

  • dˉ\bar{d} = mean of the difference scores
  • nn = number of pairs

This is the central quantity the test evaluates. A mean difference of zero would indicate no average change across subjects.

Step 3: Compute the Standard Deviation of the Differences

Measure how much the individual difference scores vary around their mean:sd=i=1n(didˉ)2n1s_d = \sqrt{\frac{\sum_{i=1}^{n}(d_i – \bar{d})^2}{n – 1}}

Where:

  • sds_d​ = standard deviation of the difference scores
  • n1n – 1 = degrees of freedom applied to produce an unbiased estimate of the population standard deviation

A larger sds_d​ reflects greater inconsistency in how subjects responded to the intervention. High variability in the differences makes it harder to detect a statistically significant effect.

Step 4: Compute the Standard Error of the Mean Difference

The standard error (SE) quantifies the precision of dˉ\bar{d} as an estimate of the true population mean difference:SEdˉ=sdnSE_{\bar{d}} = \frac{s_d}{\sqrt{n}}

As sample size increases, the standard error decreases, reflecting the greater reliability of the mean difference estimate with more data.

Step 5: Compute the t-Statistic

Divide the mean difference by its standard error:t=dˉSEdˉ=dˉsd/nt = \frac{\bar{d}}{SE_{\bar{d}}} = \frac{\bar{d}}{s_d / \sqrt{n}}

The t-statistic expresses how many standard errors the observed mean difference falls from zero. A large absolute value of ttt—in either direction—indicates that the mean difference is unlikely to have occurred by chance if the null hypothesis were true.

Degrees of Freedom

The paired t-test has degrees of freedom equal to one less than the number of pairs:df=n1df = n – 1

The degrees of freedom determine which t-distribution is used to compute the p-value. With smaller samples, the t-distribution has heavier tails, reflecting greater uncertainty. As nnn increases, the t-distribution converges toward the standard normal distribution.

Hypothesis Testing Framework

The test evaluates one of three possible hypothesis structures, depending on your research question:

Test TypeNull HypothesisAlternative HypothesisUse When
Two-tailedH0:μd=0H_0: \mu_d = 0H1:μd0H_1: \mu_d \neq 0Direction of effect is not predicted in advance
One-tailed (upper)H0:μd0H_0: \mu_d \leq 0H1:μd>0H_1: \mu_d > 0Predicting the second measurement will be higher
One-tailed (lower)H0:μd0H_0: \mu_d \geq 0H1:μd<0H_1: \mu_d < 0Predicting the second measurement will be lower

In most research contexts, the two-tailed test is the default choice. One-tailed tests require a strong directional hypothesis stated before data collection and are more susceptible to inflated Type I error if the direction is wrong.

Confidence Interval for the Mean Difference

Alongside the t-statistic and p-value, a confidence interval provides a range of plausible values for the true population mean difference μd\mu_d​:CI=dˉ±tα/2,df×SEdˉCI = \bar{d} \pm t_{\alpha/2,\, df} \times SE_{\bar{d}}

Where:

  • tα/2,dft_{\alpha/2,\, df}​ = the critical value from the t-distribution for the chosen significance level and degrees of freedom
  • A 95% confidence interval uses α=.05\alpha = .05, giving t.025,dft_{.025,\, df}

If the confidence interval does not include zero, the mean difference is statistically significant at the corresponding alpha level. The width of the interval reflects the precision of the estimate — narrower intervals arise from larger samples or smaller variability in the differences.

Worked Example: Calculating by Hand

Ten students sat a mathematics test before and after a four-week revision programme. Their scores are recorded below.

StudentPre (Xi,1X_{i,1}​)Post (Xi,2X_{i,2}​)Difference (did_i)
158657
272742
363718
455605
58079−1
667758
774806
861687
970722
1066737

Mean difference:dˉ=7+2+8+5+(1)+8+6+7+2+710=5110=5.1\bar{d} = \frac{7 + 2 + 8 + 5 + (-1) + 8 + 6 + 7 + 2 + 7}{10} = \frac{51}{10} = 5.1

Standard deviation of differences:sd=(di5.1)29=(3.61+9.61+8.41+0.01+37.21+8.41+0.81+3.61+9.61+3.61)9=84.993.07s_d = \sqrt{\frac{\sum(d_i – 5.1)^2}{9}} = \sqrt{\frac{(3.61 + 9.61 + 8.41 + 0.01 + 37.21 + 8.41 + 0.81 + 3.61 + 9.61 + 3.61)}{9}} = \sqrt{\frac{84.9}{9}} \approx 3.07

Standard error:SEdˉ=3.07100.971SE_{\bar{d}} = \frac{3.07}{\sqrt{10}} \approx 0.971

t-statistic:t=5.10.9715.25t = \frac{5.1}{0.971} \approx 5.25

Degrees of freedom: df=101=9df = 10 – 1 = 9

With t(9)=5.25t(9) = 5.25t(9)=5.25 and a two-tailed test, the p-value is approximately .001.001, indicating strong evidence that the revision programme produced a statistically significant improvement in mathematics scores.

Why stress over time when we can write it for you?

Order your assignment help now

How to Perform a Paired t-Test

Step 1: Confirm Your Data Structure

Before running any calculations, verify that your data meets the structural requirements of the paired t-test.

Check the following:

  • Two measurements per subject — Each participant has exactly one pre-test and one post-test value. No subjects are missing either measurement.
  • Meaningful pairing — The link between the two measurements is intentional and built into the study design, not imposed after data collection.
  • Continuous outcome — The dependent variable (mathematics score) is measured on an interval or ratio scale.
  • Sufficient sample size — With n=10n = 10n=10 pairs, the sample is small but workable. Normality of the differences will need careful attention.

Step 2: State Your Hypotheses

Define the null and alternative hypotheses before examining the data.H0:μd=0H_0: \mu_d = 0H1:μd0H_1: \mu_d \neq 0

  • H0H_0​ states that the mean difference between post-test and pre-test scores is zero — the revision programme had no effect.
  • H1H_1​ states that the mean difference is not zero — the programme produced a change in scores.

A two-tailed test is used here because, while an improvement is expected, the test does not formally restrict the direction of the effect. The significance level is set at α=.05\alpha = .05α=.05 prior to analysis.

Step 3: Compute the Difference Scores

For each subject, subtract the pre-test score from the post-test score:di=Xi,postXi,pred_i = X_{i,\text{post}} – X_{i,\text{pre}}

StudentPrePostdid_idi​(didˉ)2(d_i – \bar{d})^2(di​−dˉ)2
1586573.61
2727429.61
3637188.41
4556050.01
58079−137.21
6677588.41
7748060.81
8616873.61
9707229.61
10667373.61
Total5184.90

Step 4: Check the Assumptions

4a. Normality of the differences

With only 10 pairs, the Central Limit Theorem cannot be relied upon. Inspect the differences visually and run a Shapiro-Wilk test.

The difference scores are: −1, 2, 2, 5, 6, 7, 7, 7, 8, 8

These values are slightly left-skewed due to the single negative value but are broadly reasonable for a sample of this size. A Shapiro-Wilk test on these differences yields W=0.879W = 0.879, p=.126p = .126, which does not reject normality at α=.05\alpha = .05. The normality assumption is considered satisfied.

4b. Outliers in the differences

The difference score of 1-1 for Student 5 is the most unusual value. Computing its z-score:z=15.13.071.99z = \frac{-1 – 5.1}{3.07} \approx -1.99

An absolute z-score of 1.991.991.99 is well below the threshold of 3.293.293.29 for extreme outliers. No influential outliers are present.

Step 5: Calculate the Test Statistic

Using the values derived in the previous section:dˉ=5.1,sd3.07,SEdˉ0.971\bar{d} = 5.1, \quad s_d \approx 3.07, \quad SE_{\bar{d}} \approx 0.971t=dˉSEdˉ=5.10.9715.25t = \frac{\bar{d}}{SE_{\bar{d}}} = \frac{5.1}{0.971} \approx 5.25df=n1=9df = n – 1 = 9

Step 6: Determine the Critical Value and p-Value

For a two-tailed test with df=9df = 9df=9 and α=.05\alpha = .05α=.05, the critical value from the t-distribution is:tcrit=±2.262t_{\text{crit}} = \pm 2.262

Since the observed t=5.25t = 5.25 exceeds the critical value of 2.2622.262 in absolute terms, the result falls in the rejection region.

The exact two-tailed p-value associated with t(9)=5.25t(9) = 5.25 is p.001p \approx .001

Since p<.05p < .05, the null hypothesis is rejected.

Step 7: Compute the Confidence Interval

A 95% confidence interval for the mean difference is:CI95%=dˉ±tα/2,df×SEdˉCI_{95\%} = \bar{d} \pm t_{\alpha/2,\, df} \times SE_{\bar{d}}CI95%=5.1±2.262×0.971CI_{95\%} = 5.1 \pm 2.262 \times 0.971CI95%=5.1±2.197CI_{95\%} = 5.1 \pm 2.197CI95%=[2.90, 7.30]CI_{95\%} = [2.90,\ 7.30]

The interval does not include zero, which is consistent with the rejection of the null hypothesis. The true mean improvement in mathematics scores is estimated to lie between 2.90 and 7.30 points.

Step 8: Calculate Effect Size

Statistical significance tells you that an effect exists; effect size tells you how large it is. The standard effect size measure for the paired t-test is Cohen’s d:d=dˉsd=5.13.071.66d = \frac{\bar{d}}{s_d} = \frac{5.1}{3.07} \approx 1.66

Cohen’s d is interpreted using conventional benchmarks:

Cohen’s dInterpretation
0.2Small effect
0.5Medium effect
0.8Large effect
> 1.0Very large effect

A Cohen’s d of 1.661.661.66 indicates a very large effect — the revision programme produced a mean improvement that was substantially larger than the typical variability in difference scores.

Step 9: Interpret and Report the Results

A complete statistical report includes the mean difference, standard deviation of differences, t-statistic, degrees of freedom, p-value, confidence interval, and effect size.

Example write-up:

A paired sample t-test was conducted to evaluate whether the four-week revision programme produced a significant change in mathematics scores. The mean post-test score was significantly higher than the mean pre-test score (dˉ=5.10\bar{d} = 5.10dˉ=5.10, sd=3.07s_d = 3.07sd​=3.07), t(9)=5.25t(9) = 5.25t(9)=5.25, p=.001p = .001p=.001, 95% CI [2.90, 7.30]. The effect size was very large (d=1.66d = 1.66d=1.66), indicating that the improvement in scores substantially exceeded the typical variability between students. These results provide strong evidence that the revision programme had a meaningful positive impact on mathematics performance.

Paired vs. Independent t-Test

Paired vs. Independent t-Test

Advantages and Limitations of the Paired Sample t-Test

Advantages and Limitations of the Paired Sample t-Test

Can’t fit writing into your busy day?

We can

Software and Tools for Paired t-Test

R

R provides the paired t-test through the built-in t.test() function. The paired = TRUE argument is all that distinguishes it from an independent samples test.

Base R:

r

pre  <- c(58, 72, 63, 55, 80, 67, 74, 61, 70, 66)
post <- c(65, 74, 71, 60, 79, 75, 80, 68, 72, 73)

result <- t.test(post, pre, paired = TRUE)
print(result)

Output:

	Paired t-test

data:  post and pre
t = 5.2522, df = 9, p-value = 0.0005151
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
 2.904089 7.295911
sample estimates:
mean of the differences 
                    5.1

Checking assumptions in R:

r

differences <- post - pre

shapiro.test(differences)
hist(differences, main = "Histogram of differences", xlab = "d_i")
qqnorm(differences); qqline(differences)
boxplot(differences, main = "Boxplot of differences")

Effect size using effectsize:

r

install.packages("effectsize")
library(effectsize)

cohens_d(post, pre, paired = TRUE)

Using rstatix for a tidy workflow:

r

install.packages("rstatix")
library(rstatix)
library(tidyr)

df <- data.frame(
  student = rep(1:10, 2),
  time    = rep(c("pre", "post"), each = 10),
  score   = c(pre, post)
)

df %>% t_test(score ~ time, paired = TRUE, detailed = TRUE)

Python

Using scipy.stats:

python

from scipy import stats

pre  = [58, 72, 63, 55, 80, 67, 74, 61, 70, 66]
post = [65, 74, 71, 60, 79, 75, 80, 68, 72, 73]

t_stat, p_value = stats.ttest_rel(post, pre)
print(f"t = {t_stat:.4f}, p = {p_value:.4f}")
# t = 5.2522, p = 0.0005

Confidence interval and effect size manually:

python

import numpy as np
from scipy import stats

differences = np.array(post) - np.array(pre)
n    = len(differences)
dbar = np.mean(differences)
sd   = np.std(differences, ddof=1)
se   = sd / np.sqrt(n)

t_crit = stats.t.ppf(0.975, df=n-1)
ci_lower = dbar - t_crit * se
ci_upper = dbar + t_crit * se
cohens_d = dbar / sd

print(f"Mean difference: {dbar:.2f}")
print(f"95% CI: [{ci_lower:.2f}, {ci_upper:.2f}]")
print(f"Cohen's d: {cohens_d:.2f}")

Using pingouin for a complete output:

python

pip install pingouin
import pingouin as pg
import pandas as pd

df = pd.DataFrame({"pre": pre, "post": post})

result = pg.ttest(df["post"], df["pre"], paired=True)
print(result)

Normality check:

python

stat, p = stats.shapiro(differences)
print(f"Shapiro-Wilk: W = {stat:.3f}, p = {p:.3f}")

SPSS

SPSS performs the paired t-test through the Analyze menu with no syntax required, though syntax is provided below for reproducibility.

Via the menu:

  1. Open your dataset. Ensure data is in wide format — one row per subject, with separate columns for the pre-test and post-test scores.
  2. Navigate to Analyze → Compare Means → Paired-Samples T Test.
  3. In the dialog box, move pre into the Variable 1 slot and post into the Variable 2 slot of Pair 1.
  4. Click Options to set the confidence interval (default 95%) and handling of missing values.
  5. Click OK.

SPSS syntax:

spss

T-TEST PAIRS = pre WITH post (PAIRED)
  /CRITERIA = CI(.9500)
  /MISSING = ANALYSIS.

Checking assumptions in SPSS:

spss

COMPUTE diff = post - pre.
EXECUTE.

EXAMINE VARIABLES = diff
  /PLOT BOXPLOT HISTOGRAM NPPLOT
  /STATISTICS DESCRIPTIVES
  /CINTERVAL 95
  /MISSING LISTWISE
  /NOTOTAL.

Excel

Excel does not have a dedicated paired t-test function, but the test can be run using either the Data Analysis ToolPak or a manual formula approach.

Method 1: Data Analysis ToolPak

  1. Enable the ToolPak if needed: File → Options → Add-ins → Analysis ToolPak → Go → tick the box → OK.
  2. Enter your pre scores in column A and post scores in column B, with headers in row 1.
  3. Navigate to Data → Data Analysis → t-Test: Paired Two Sample for Means → OK.
  4. Set Variable 1 Range to the post column (B1:B11) and Variable 2 Range to the pre column (A1:A11).
  5. Set Hypothesized Mean Difference to 0.
  6. Tick Labels if your range includes headers.
  7. Set Alpha to 0.05.
  8. Choose an output range and click OK.

Method 2: Formula approach

CellFormulaPurpose
C2=B2-A2Difference score for row 2 (copy down to C11)
E1=AVERAGE(C2:C11)Mean difference dˉ\bar{d}
E2=STDEV(C2:C11)Standard deviation sds_dsd​
E3=E2/SQRT(COUNT(C2:C11))Standard error SEdˉSE_{\bar{d}}SEdˉ​
E4=E1/E3t-statistic
E5=COUNT(C2:C11)-1Degrees of freedom
E6=T.DIST.2T(ABS(E4),E5)Two-tailed p-value
E7=E1-T.INV.2T(0.05,E5)*E3Lower 95% CI bound
E8=E1+T.INV.2T(0.05,E5)*E3Upper 95% CI bound

No time to research? No time to write?

We have both

FAQs

What is the difference between a paired t-test and a regular t-test?

A paired t-test compares two related measurements (dependent samples).
A “regular” t-test usually refers to an independent t-test, which compares two unrelated groups.

What is the difference between paired and unpaired t-test?

Paired t-test: same or matched subjects, focuses on differences within pairs.
Unpaired t-test: different subjects in each group, compares group means directly.

Is 0.05 reject or fail to reject?

It depends on the p-value:
If p ≤ 0.05 → Reject the null hypothesis
If p > 0.05 → Fail to reject the null hypothesis

Company

Welcome to our writing center! Whether you’re working on a writing assignment or simply need help with a paragraph, we’re here to assist you. Our resources are licensed under a creative commons attribution-noncommercial-sharealike 4.0 international license, so feel free to use them to summarize, revise, or improve your essay writing. Our goal is to help you navigate the transition to college writing and become a confident writer in college. From research process to writing strategies, we can support you with different kinds of writing.

Services Offered

  • Professional custom essay writing service for college students
  • Experienced writers for high-quality academic research papers
  • Affordable thesis and dissertation writing assistance online
  • Best essay editing and proofreading services with quick turnaround
  • Original and plagiarism-free content for academic assignments
  • Expert writers for in-depth literature reviews and case studies

Services Offered

  • Professional custom essay writing service for college students
  • Experienced writers for high-quality academic research papers
  • Affordable thesis and dissertation writing assistance online
  • Best essay editing and proofreading services with quick turnaround
  • Original and plagiarism-free content for academic assignments
  • Expert writers for in-depth literature reviews and case studies