Sampling/ Change in Mean
Sample Size Estimation, Measuring Change

How to Calculate Sample Size to Detect a Change in a Numeric Outcome

A change in mean compares a numeric average across two groups, or the same group at two points in time. This guide explains the underlying statistics first, then shows how to apply them using AnalyZ Solutions.

6 min read Sample Size Estimation Intermediate

Many programme evaluations depend on comparing a numeric average across two groups, or across time. Did average income rise? Did test scores improve? Did the number of clinic visits per household increase? This tool answers that question when the outcome is a continuous number rather than a percentage, whether or not random assignment was possible, and whether the same people were tracked over time or two separate samples were compared. This guide first explains the general formula behind the calculation, then walks through how to apply it in AnalyZ Solutions.

01The general sample size formula

The most important decision this tool asks you to make is not a number at all. It is whether you are comparing two independent groups or the same group measured twice. This single choice changes the formula, the required inputs, and, usually significantly, the required sample size.

Two independent groups

Use this when comparing two separate samples: a treatment group against a comparison group, or two different people measured at baseline and again at endline. No individual is measured twice.

n per group = 2(Z1−α/2 + Z1−β)2 × σ2 / Δ2 This is the sample required in each group. Total sample across both groups is twice this figure.

Each symbol in this formula plays a specific role.

The factor of 2 in front of the formula exists because comparing two independent group means involves two separate sources of sampling variation, one from each group, rather than one. This is different from a proportion comparison, where a pooled variance term serves a similar purpose but is expressed differently, since the amount of variance in a proportion depends on the proportion itself in a way that a continuous outcome's variance does not.

Same group, before and after

Use this when the same individuals are measured at both time points, a genuine panel or cohort rather than two separate samples. Because each person acts as their own comparison, this design is statistically more efficient. It typically needs a meaningfully smaller sample to detect the same size of change.

n = (Z1−α/2 + Z1−β)2 × 2σ2(1−ρ) / Δ2 This is the number of matched pairs required, meaning the number of individuals tracked, not the number of measurements.

This formula shares Z1−α/2, Z1−β, σ, and Δ with the independent groups version above, but introduces one new term.

The term 2σ2(1−ρ) is the variance of the difference between two correlated measurements on the same person. When ρ is 0, this equals 2σ2, matching the independent groups formula exactly, since there is no relationship between the two measurements to exploit. As ρ rises toward 1, this term shrinks toward 0, reflecting that a person whose baseline and endline values are nearly identical relative to their peers contributes very little uncertainty to the estimated change.

Choosing your confidence level and power

Confidence level and power are judgment calls, not fixed rules, and they deserve as much thought as the effect size itself.

Confidence level reflects how willing you are to risk a false alarm, concluding a change happened when it actually did not. 95% is the standard default, meaning a 5% chance of that false alarm. A higher level, such as 99%, is worth considering before a costly or hard to reverse decision, such as expanding a programme nationally based on the result. A lower level, such as 90%, is sometimes acceptable for lower stakes, exploratory work.

Power reflects how willing you are to risk missing a real change entirely. 80% power is the conventional minimum, meaning a 20% chance of failing to detect a genuine change of the size specified. 90% power is worth considering for high stakes decisions, such as a funding renewal that depends on demonstrating measurable impact.

Undermining either value carries a real cost. A confidence level set too low increases the risk of reporting a change that is actually just noise. Power set too low means a genuinely effective programme has a meaningful chance of producing a study that fails to detect its own impact, an outcome that is difficult to distinguish afterward from the programme simply not working. Once data collection is complete, there is no way to fix an underpowered study after the fact.
The standard deviation assumption drives this calculation more than any other input. Unlike a proportion, where the most conservative assumption, 50%, is always available as a fallback, there is no equivalent built in worst case default for σ. Pull this figure from a pilot study, a prior round of the same instrument, or comparable published data wherever possible, not a guess. An underestimated σ is one of the most common reasons a continuous-outcome study ends up underpowered in practice.

Choosing one-tailed or two-tailed

Both formulas above use Z1−α/2, the two-tailed critical value, appropriate when you want to detect a change in either direction, an increase or a decrease. If your interest is specifically and only in one direction, for example only whether a programme raises average income, and a decrease genuinely does not need to be detected or reported, a one-tailed test using Z1−α instead can be used. For 95% confidence, this changes the critical value from 1.96 to approximately 1.64, producing a smaller required sample for the same nominal confidence level.

Two-tailed is the safer, more defensible default. Choosing one-tailed specifically to reduce the required sample, without a genuine reason a change in the opposite direction is impossible or irrelevant, is a common way evaluations end up under-protected against being wrong.

Accounting for cluster sampling

If your sample will be drawn from clusters, villages, schools, or facilities, rather than a simple random sample, a design effect should be applied to either formula above. It defaults to 1, meaning no clustering effect assumed, and is always editable. See the dedicated guide on Design Effect and ICC for how to set this correctly.

How to Calculate This in AnalyZ Solutions

The Change in Mean tool applies both formulas automatically based on the design you select, along with the one-tailed or two-tailed choice and the design effect.

  1. Choose your design. Select Two independent groups or Same group, before and after. Read the short description AnalyZ Solutions displays under each option if you are unsure which applies to your study.
  2. Set confidence and power. Enter both as numbers. Default values are 95% and 80%, respectively.
  3. Enter the expected standard deviation and the change to detect. Both should be in the same units as the outcome you are measuring, for example both in points, both in local currency, or both in days.
  4. For the paired design, enter an assumed correlation. If unsure, 0.5 is a reasonable default for most repeated measures indicators.
  5. Set your expected non-response rate. This inflates the recruitment target so that, after accounting for people who do not respond, you still end up with enough completed pairs or completed groups.
  6. Choose one-tailed or two-tailed. Two-tailed is selected by default and is appropriate for almost all evaluations.
  7. Set a design effect, if sampling by cluster. Enter a value directly, or calculate one automatically from an intraclass correlation and average cluster size.
  8. Calculate. The result shows the required sample, an interpretation of what it means, and the exact formula used, including which test type and design effect were applied.

Watch calculating sample size to detect change in mean in the AnalyZ Solutions interface

02Worked example

A literacy programme wants to detect a change in average test score among the same cohort of learners, tested before and after a six month course. The expected standard deviation of scores is 12 points, the programme targets a 6 point improvement, and the assumed correlation between someone's before and after score is 0.5.

Inputs
DesignPaired
Confidence level95%
Power80%
Expected standard deviation12
Change to detect6
Correlation (ρ)0.5
Non-response rate10%
Test typeTwo-tailed
~36
pairs to recruit, incl. non-response

Before the non-response adjustment, the minimum statistical requirement is about 32 pairs. The 10% non-response rate inflates this to the recruitment target, so the study still ends with enough completed pairs after accounting for learners who cannot be reached or decline to participate at the second test.

The same 6 point change, calculated instead as two independent groups of learners rather than the same learners tracked twice, would require about 63 people per group before the non-response adjustment, roughly double, again illustrating the efficiency of paired designs whenever tracking the same individuals is feasible. That gap grows even larger as the assumed correlation ρ increases.

03Common mistakes to avoid

Frequently Asked Questions
How is this different from Change in Proportion?
The design logic, independent groups versus paired before and after, is the same. The difference is the outcome type. Use Change in Proportion when the outcome is a percentage or rate, and Change in Mean when it is a numeric average such as a score, an amount, or a count. See How to Calculate Sample Size to Detect a Change in Proportion.
What if this is a randomised controlled trial specifically?
Use the RCT tool instead. It also supports continuous outcomes and additionally accounts for attrition, which this tool does not. See How to Calculate Sample Size for a Randomized Controlled Trial.
Where do I get a realistic standard deviation if I have no pilot data?
Check published studies using the same or a similar outcome measure in a comparable population. If truly nothing is available, a conservative approach is to use a wider standard deviation than expected, which produces a larger, safer sample size rather than a smaller, riskier one.
What if I do not know the correlation ρ for a paired design?
0.5 is a reasonable default for most repeated measures indicators when no prior data exists. If a previous round of the same or a similar panel is available, calculating ρ directly from that data will give a more accurate, and often more favourable, required sample than a generic assumption.
Why does the paired design need fewer participants for the same change?
Because each person acts as their own comparison, the variability that comes from comparing different individuals to each other is removed from the calculation. Only the variability in how much each person changed remains, which is smaller than the variability between two separate groups of people, provided baseline and endline values are meaningfully correlated.
Should I always use a two-tailed test?
In almost all evaluation contexts, yes. Two-tailed testing is appropriate whenever a change in either direction would be meaningful to detect and report. One-tailed testing is a narrower, less conservative choice that should only be used with a clear, defensible reason a change in one specific direction is the sole outcome of interest.
Does a design effect apply to this tool?
Yes, if the sample will be drawn from clusters rather than a simple random sample. It defaults to 1, meaning no clustering effect, and can be entered directly or calculated from an intraclass correlation and average cluster size. See Design Effect and ICC Explained.

Ready to size your comparison?

Open the Change in Mean tool in AnalyZ Solutions. Free, browser based, your data never leaves your device.

Try it out
Related Guides