Inferential Statistics • Lesson 16

Paired t-Test

Learn how to compare two related measurements using the paired t-test, calculate differences, test hypotheses, and interpret results in real-world data analytics.

Paired Datat-TestHypothesis TestingData Analytics

What You Will Learn

✓When to use a paired t-test
✓How paired observations are different from independent samples
✓How to calculate paired differences
✓How to calculate the standard error
✓How to calculate the t-statistic
✓How to interpret the result

1. What Is a Paired t-Test?

A paired t-test is used when the two measurements being compared are naturally connected or matched.

Instead of treating the two groups as independent, we analyze the difference within each pair.

Before vs After

Same person measured before and after an intervention.

Matched Subjects

Two observations deliberately matched on important characteristics.

Repeated Measurements

The same subject or unit measured under two conditions.

Think in Pairs

Customer

A

→

Before

₹2,400

→

After

₹2,700

Difference

₹2,700 − ₹2,400 = ₹300

2. The Key Idea: Calculate Differences

The paired t-test transforms the original paired observations into a single set of differences.

Difference for each pair

dᵢ = Afterᵢ − Beforeᵢ

Once the differences are calculated, the paired t-test essentially becomes a one-sample t-test on the differences.

Example: Website Redesign

Suppose the same five websites are measured for average page-load time before and after a performance improvement.

WebsiteBeforeAfterDifference
A520500-20
B610570-40
C480450-30
D550510-40
E590560-30

Differences:

−20, −40, −30, −40, −30 milliseconds

3. Hypotheses for a Paired t-Test

The hypotheses are usually written in terms of the population mean difference, represented by μd.

Null Hypothesis

H₀: μd = 0

There is no average difference between the paired measurements.

Alternative Hypothesis

Hₐ: μd ≠ 0

There is an average difference between the paired measurements.

Directional alternatives

Two-sided: Hₐ: μd ≠ 0

Greater than: Hₐ: μd > 0

Less than: Hₐ: μd < 0

4. Calculate the Mean Difference

After calculating every paired difference, calculate their average.

d̄ = Σdᵢ / n

Our example

Differences: −20, −40, −30, −40, −30

Sum = −160

n = 5

d̄ = −160 / 5 = −32 ms

5. Standard Error of the Mean Difference

The standard error is calculated using the standard deviation of the paired differences.

SE = sd / √n

Here, sd is the sample standard deviation of the differences and n is the number of pairs.

6. The Paired t-Test Formula

t = d̄ / (sd / √n)

Degrees of freedom:

df = n − 1

d̄

Mean difference

sᵈ

SD of differences

n

Number of pairs

df

Degrees of freedom

Worked Example

Suppose the five paired differences have:

Mean difference

d̄ = −32

SD of differences

sᵈ ≈ 8.37

Number of pairs

n = 5

Step 1 — Standard Error

SE = 8.37 / √5 ≈ 3.74

Step 2 — t-statistic

t = −32 / 3.74 ≈ −8.56

Step 3 — Degrees of freedom

df = 5 − 1 = 4

Important:

A large absolute t-statistic indicates that the observed mean difference is large relative to its estimated standard error. Statistical significance still requires comparing the result with the appropriate p-value or critical value.

7. Why Use a Paired Test?

Pairing can reduce the effect of differences between subjects because each subject is compared with itself or with a deliberately matched counterpart.

Example: Employee Training

Suppose the same employees take a productivity test before and after training.

Before Training
→
Same Employee
→
After Training

8. Paired vs Two-Sample t-Test

FeaturePaired t-TestTwo-Sample t-Test
RelationshipRelated / matchedIndependent groups
Main analysisDifferences within pairsDifference between group means
ExampleBefore vs AfterGroup A vs Group B

9. Important Assumptions

•

Each observation has a meaningful partner.

•

Different pairs should be independent of one another.

•

The outcome should be quantitative so that differences can be calculated.

•

For small samples, the distribution of the paired differences should be reasonably close to normal.

•

The pairing should make practical sense for the research question.

Interactive Practice

Test your understanding before moving ahead.

CHECK YOUR UNDERSTANDING

When is a paired t-test most appropriate?

CHECK YOUR UNDERSTANDING

What does the paired t-test analyze directly?

CHECK YOUR UNDERSTANDING

What is the usual null hypothesis for a paired t-test?

CHECK YOUR UNDERSTANDING

If n = 20 paired observations, what are the degrees of freedom?

CHECK YOUR UNDERSTANDING

Which quantity is used to calculate the standard error in a paired t-test?

CHECK YOUR UNDERSTANDING

Which example represents paired data?

Fill in the Blanks

Fill in the Blank

A paired t-test analyzes the ______ between each pair of observations.

Fill in the Blank

For a paired t-test, degrees of freedom are n − ______.

Fill in the Blank

The standard error of the mean difference is sd divided by the square root of ______.

Fill in the Blank

The standard null hypothesis for a paired t-test states that the mean difference equals ______.

Data Analytics Challenge

Marketing Campaign Performance

A company measures the same 10 stores before and after a new marketing campaign. The mean increase in weekly sales is ₹1,200, and the standard deviation of the paired differences is ₹900.

Given:

  • Mean difference = ₹1,200
  • SD of differences = ₹900
  • n = 10

Calculate the standard error:

SE = 900 / √10

SE ≈ ₹284.60

Calculate the t-statistic:

t = 1,200 / 284.60

t ≈ 4.22

Degrees of freedom:

df = 10 − 1 = 9

Final Challenge

Before vs After Customer Spending

The same 25 customers are measured before and after a loyalty program. The average increase in spending is ₹300 and the standard deviation of the paired differences is ₹500.

Calculate:

  1. The standard error
  2. The t-statistic
  3. The degrees of freedom

SE = 500 / √25 = ₹100

t = 300 / 100 = 3

df = 25 − 1 = 24

Lesson Summary

✓ Use a paired t-test for related or matched observations.

✓ Calculate a difference for every pair.

✓ Analyze the mean of those differences.

✓ Standard error = sᵈ / √n.

✓ t = d̄ / (sᵈ / √n).

✓ Degrees of freedom = n − 1.

✓ Statistical significance requires a p-value or critical-value comparison; the t-statistic alone is not the final decision.