Sample Size for Paired Sample Tests

Master sample size calculations for paired designs, crossover trials, and before-after studies.

Quick answer

Sample Size for Paired Sample Tests in DataStatPro helps researchers understand the method, choose appropriate assumptions and outputs, and connect the analysis to publication-ready reporting. Master sample size calculations for paired designs, crossover trials, and before-after studies.

Paired-Sample Size Calculation with DataStatPro: Zero to Hero Tutorial

This tutorial takes you from the foundations of paired and within-subject designs through pre-post studies, matched pairs, crossover trials, paired effect sizes, correlation, calculator use, interpretation, reporting, and common mistakes. It is designed for studies where each participant or unit contributes two linked measurements.


Table of Contents

  1. Prerequisites and Background Concepts
  2. What Is Paired-Sample Size Planning?
  3. When to Use Paired-Sample Calculations
  4. The Mathematics Behind Paired-Sample Power
  5. Correlation, Carryover, and Attrition
  6. Using the DataStatPro Calculator
  7. Worked Examples
  8. Common Mistakes and How to Avoid Them
  9. Troubleshooting
  10. Quick Reference Cheat Sheet

1. Prerequisites and Background Concepts

1.1 Paired Measurements

Paired data arise when two measurements are linked:

  • Pre-treatment and post-treatment values from the same participant.
  • Matched case and control pairs.
  • Left-eye and right-eye measurements.
  • Crossover trial measurements under two treatments.
  • Before and after quality-improvement measurements on the same unit.

The analysis focuses on within-pair differences, not two independent group means.

1.2 Difference Scores

For each pair:

Di=Xpost,iXpre,iD_i = X_{post,i} - X_{pre,i}

The paired test evaluates whether the mean difference Dˉ\bar{D} differs from 0 or another target value.

1.3 Why Pairing Can Reduce Sample Size

Pairing removes between-person variability. If paired measurements are highly correlated, fewer participants may be needed than in an independent-groups design.


2. What Is Paired-Sample Size Planning?

Paired-sample size planning answers:

How many pairs are needed to detect a meaningful within-pair change or difference with adequate power?

The unit of sample size is the pair, participant, matched set, or crossover unit.


3. When to Use Paired-Sample Calculations

Use paired-sample calculations for:

  • Pre-post intervention studies.
  • Matched-pair studies.
  • Crossover trials.
  • Repeated measures on the same subject.
  • Symmetric body-part comparisons.
  • Paired binary outcomes, when using paired-proportion methods.

Do not use paired planning for independent treatment and control groups.


4. The Mathematics Behind Paired-Sample Power

4.1 Paired t-Test Effect Size

The paired effect size is:

dz=μDσDd_z = \frac{\mu_D}{\sigma_D}

Where:

  • μD\mu_D = expected mean difference.
  • σD\sigma_D = standard deviation of paired differences.

4.2 Standard Deviation of Differences

If the two measurements have common standard deviation σ\sigma and correlation rr:

σD=σ2(1r)\sigma_D = \sigma\sqrt{2(1-r)}

Higher correlation lowers σD\sigma_D, which can reduce required sample size.

4.3 Approximate Sample Size

For a paired mean difference:

n(z1α/2+z1βdz)2n \approx \left(\frac{z_{1-\alpha/2} + z_{1-\beta}}{d_z}\right)^2

Use exact t-based calculator results for final planning.

4.4 Paired Binary Outcomes

For paired binary outcomes, power often depends on discordant pairs rather than all pairs. McNemar-style planning focuses on pairs that change from no to yes or yes to no.


5. Correlation, Carryover, and Attrition

5.1 Estimating Correlation

Use:

  • Pilot paired data.
  • Similar published studies.
  • Historical repeated-measure datasets.
  • Conservative sensitivity analysis.

If uncertain, plan across several correlations such as 0.3, 0.5, and 0.7.

5.2 Crossover Carryover

Crossover trials require:

  • Adequate washout.
  • Stable condition.
  • No permanent treatment effect after the first period.
  • Assessment of period and sequence effects.

5.3 Attrition

A participant with only one measurement may not contribute to paired analysis. Inflate the required number of pairs:

nrecruit=ncomplete1dropoutn_{recruit} = \frac{n_{complete}}{1 - dropout}


6. Using the DataStatPro Calculator

Step-by-Step Guide

Step 1: Select paired-sample analysis.

Choose paired means or paired proportions.

Step 2: Enter the expected mean difference.

Use the smallest within-person change that would matter.

Step 3: Enter the SD of differences or correlation-based inputs.

If you know σD\sigma_D, enter it directly. If not, use individual SD and correlation when supported.

Step 4: Set alpha, power, and tail direction.

Use two-tailed tests unless a one-direction change is justified before data collection.

Step 5: Review required complete pairs.

Remember this is the number of analyzable pairs, not merely enrolled participants.

Step 6: Inflate for incomplete pairs.

Account for missing follow-up, failed washout, or unusable matched controls.


7. Worked Examples

Example 1: Weight-Loss Pre-Post Study

Expected mean loss = 5 kg. Individual SD = 8 kg. Pre-post correlation = 0.85.

Calculate the SD of differences:

σD=82(10.85)=80.30=4.38\sigma_D = 8\sqrt{2(1-0.85)} = 8\sqrt{0.30} = 4.38

Effect size:

dz=5/4.38=1.14d_z = 5/4.38 = 1.14

Use DataStatPro for the exact required number of complete paired observations, then inflate for missing post-treatment weights.

Example 2: Educational Pre-Post Intervention

Expected improvement = 5 points. Individual SD = 12. Pre-post correlation = 0.60.

σD=122(10.60)=120.80=10.73\sigma_D = 12\sqrt{2(1-0.60)} = 12\sqrt{0.80} = 10.73

dz=5/10.73=0.47d_z = 5/10.73 = 0.47

This is a moderate paired effect. The final required n should be calculated using the paired-sample calculator and increased for expected absenteeism.

Example 3: Crossover Trial

A crossover trial compares Drug A and Drug B in the same participants. Planning should use the within-person treatment difference and account for:

  • Expected treatment difference.
  • SD of within-person treatment differences.
  • Dropout before the second period.
  • Possible carryover or period effects.

8. Common Mistakes and How to Avoid Them

Mistake 1: Using Independent Two-Sample Planning for Paired Data

This usually overestimates required sample size when correlation is positive.

Mistake 2: Assuming Very High Correlation Without Evidence

Overstating correlation can underpower the study.

Mistake 3: Ignoring Missing Follow-Up

Incomplete pairs reduce analyzable sample size.

Mistake 4: Forgetting Carryover in Crossover Trials

Carryover can invalidate paired comparisons.

Mistake 5: Planning on Individual SD When Difference SD Is Needed

Paired tests use the variability of differences.


9. Troubleshooting

ProblemLikely causeWhat to do
Required n seems tinyVery high assumed correlationRun lower-correlation sensitivity checks
Required n seems largeDifference scores are variableReassess measurement reliability
Many enrolled participants unusableMissing second measurementInflate recruitment and improve follow-up
Crossover results are hard to interpretCarryover or period effectsRevisit washout and model period effects
Calculator result differs from independent designPairing changes varianceUse paired result for paired design

10. Quick Reference Cheat Sheet

QuantityFormula or meaning
Difference scoreDi=X2iX1iD_i = X_{2i} - X_{1i}
Paired effectdz=μD/σDd_z = \mu_D/\sigma_D
Difference SDσD=σ2(1r)\sigma_D = \sigma\sqrt{2(1-r)}
Complete pairsRequired analyzable paired observations
Recruitment targetn/(1dropout)n/(1-dropout)

Reporting Template

A paired-sample power analysis used α=[value]\alpha=[value], power=[value], expected mean difference [value], SD of differences [value], and [two/one]-tailed testing. The required number of complete pairs was [n], inflated to [n] to allow for incomplete follow-up.