Power and Sample Size for Paired t

On this page
  1. Purpose
  2. Key Capabilities
  3. Statistical Methods
  4. Input Fields & Options
  5. Output Descriptions
  6. Worked Example

Purpose

Power and Sample Size for Paired t plans a study in which each unit is measured twice, for example before and after a change, with two methods, or on two fixtures, and the question is whether the mean difference is zero. It answers how many pairs are needed to detect a mean difference that matters, what power a planned number of pairs gives, or the smallest mean difference a given number of pairs can detect. Enter any two of sample size, difference and power, and the tool solves for the third. Use it before a paired t-test.

Key Capabilities

  • Solves for number of pairs, power or difference: leave blank the one you want.
  • Several values at once, e.g. differences “0.5 1” and power values “0.8 0.9”, give one row for each combination.
  • Two-sided (Mean difference ≠ 0) or one-sided (Mean difference < 0, Mean difference > 0) alternatives, at the confidence level you choose.
  • When solving for sample size, reports the whole number of pairs and the actual power it gives.
  • Power curve of power against number of pairs for each difference, with the solved points marked.

Statistical Methods

A paired t-test is a one-sample t-test on the differences within each pair, so the calculation is that of the 1-sample t applied to the differences. It assumes the differences are roughly normal with standard deviation σ_d. The significance level is α = 1 − confidence level / 100, and the standardised difference is d = mean difference / σ_d.

Power is computed from the noncentral t distribution with n − 1 degrees of freedom and noncentrality parameter δ = d·√n, where n is the number of pairs: for a two-sided test, power = P(T > t₁₋α/₂) + P(T < −t₁₋α/₂); for a one-sided test only the tail on the side of the alternative counts, so a mean difference on the other side gives a power near 0 (and solving for sample size from it returns an error message). For sample size, the n that gives the target power is found and rounded up, and the power at that n is reported as the actual power. For difference, the smallest mean difference that reaches the target power with the given n is found.

The standard deviation to enter is that of the paired differences, not of the individual readings. When the two readings on a unit move together, σ_d is much smaller than the unit-to-unit spread, which is why a paired design usually needs far fewer units than two independent groups. Power rises with the number of pairs and the difference, and falls as σ_d grows.

Input Fields & Options

Field

Description

Sample sizes

Number of pairs. Space or comma-separated, e.g. “10 20 30”. Leave blank to solve for sample size.

Differences

Space or comma-separated, e.g. “1 2 3”. The mean paired difference you want to detect. Leave blank to solve for difference.

Power values

Space or comma-separated, e.g. “0.8 0.9”. Leave blank to solve for power.

Standard deviation of the differences

Required. Assumed or historical standard deviation of the paired differences, e.g. from a pilot run.

Confidence level

Default 95 (α = 0.05); 75 to 100.

Alternative hypothesis

Mean difference ≠ 0 (default), Mean difference < 0 or Mean difference > 0.

Power curve

Ticked by default: draws power against sample size.

Title

Title shown on the output and the power curve.

power-and-sample-size-paired-t-inputs


Figure 1 — Solving for sample size: Differences = 1, Power values = 0.8 0.9, Standard deviation of the differences = 1.5, two-sided at 95% confidence.

Output Descriptions

  • Settings — what was solved for, the standard deviation of differences, the confidence level and the alternative hypothesis.
  • Results — one row per combination: difference, sample size (pairs), and target and actual power when solving for sample size, or power when solving for power, or difference when solving for difference.
  • Power Curve — power against sample size for each difference, with the calculated points marked.
  • PDF export via Download.

power-and-sample-size-paired-t-output


Figure 2 — Results for the example: 20 engines for 80% power and 26 for 90% power to detect a 1 g/kWh change in fuel consumption.

Worked Example

An engine plant is trialling new calibration software and will test each engine on the bench before and after the update. A change of 1 g/kWh in specific fuel consumption would matter, and earlier before-and-after tests put the standard deviation of the differences at 1.5 g/kWh. The test engineer leaves Sample sizes blank, enters Differences = 1, Power values = 0.8 0.9 and Standard deviation of the differences = 1.5, and keeps the two-sided alternative at 95% confidence.

The tool needs 20 engines for 80% power (actual power 0.807) and 26 for 90% power (actual power 0.904). The 12 engines available in one week would give a power of 0.558. If the bench results are noisier than expected, with σ_d = 2 g/kWh, 34 engines are needed for 80% power. If the only question is whether consumption improves, a one-sided alternative needs 16 engines for 80% power.