Sampling/
Longitudinal Study
Sample Size Estimation, Measuring Change
How to Calculate Sample Size for a Longitudinal Study
A longitudinal study follows the same people across multiple rounds of data collection. This guide explains the underlying statistics first, then shows how to apply them using AnalyZ Solutions.
6 min read
Sample Size Estimation
Intermediate
A longitudinal study follows the same group of people across multiple rounds of data collection. Unlike the other tools in Measuring Change, this one is not a hypothesis test. It estimates a value with a stated precision at the final wave, while accounting for the participants you expect to lose along the way. 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 starting point is the same precision-based formula used for a single cross-sectional survey, for either a proportion or a mean.
n0 = Z2 × p(1 − p) / e2 or Z2 × σ2 / e2
Attrition, participants who drop out between waves, compounds with each additional round. A study with 20% attrition per wave retains only 64% of its original sample by the third wave, since 0.8 × 0.8 = 0.64. To keep the required sample at the final wave, more people must be enrolled at baseline than the precision formula alone suggests.
enrol = n0 / (1 − attrition)(waves − 1)
Choosing your confidence level and margin of error
Because this tool estimates a value at the final wave rather than testing a specific hypothesis, it uses confidence level and margin of error rather than power. There is no beta or effect size to specify here, only how precise the final-wave estimate needs to be.
Confidence level reflects how sure you want to be that the final estimate falls within the stated margin of error. 95% is the standard default. A higher level increases the required sample at every wave, compounding through the attrition adjustment.
Margin of error reflects how much imprecision in the final estimate is acceptable. A narrower margin of error, meaning a more precise final result, requires a larger baseline sample, an effect that is amplified by attrition across multiple waves in a way it is not in a single cross-sectional survey.
Setting confidence or margin of error too loosely undermines the value of tracking a panel at all. A study that goes to the effort and cost of following the same people across multiple waves, only to end with an imprecise final estimate, has spent that additional effort without the corresponding benefit.
This formula assumes attrition is random. If the people who drop out differ systematically from those who remain, for example if programme dropouts are also more likely to leave the study, the remaining sample is biased in a way that enrolling more people at baseline cannot fix.
How to Calculate This in AnalyZ Solutions
- Choose what you are estimating. Select Proportion or Mean, as with the Cross-sectional tool.
- Set confidence and margin of error. These apply to the estimate at the final wave.
- Enter the number of waves and the expected attrition per wave. The tool compounds this across rounds automatically.
- Enter a population size, if relevant. This enables the finite population correction, applied automatically when a population size is entered.
- Set a design effect, if sampling by cluster. Defaults to 1 and is always editable, applied before the attrition adjustment.
VIDEO WALKTHROUGH PLACEHOLDER, 90 SECONDS
A short screen recording showing these steps in the AnalyZ Solutions interface can be embedded here.
02Worked example
A nutrition programme tracks the same households across three waves, roughly a year apart. Baseline stunting prevalence is expected around 30%, with a 5% margin of error at 95% confidence, and 20% attrition expected between each wave.
Inputs
What you are measuringProportion
Confidence level95%
Margin of error5%
Expected proportion30%
Number of waves3
Attrition per wave20%
~505
households to enrol at baseline
Of these, roughly 323 are needed at the final wave to meet the stated precision. The gap between 323 and 505 is entirely the cost of two rounds of attrition compounding at 20% each.
Frequently Asked Questions
Is this the same as Change in Proportion measured over time?
No. Longitudinal estimates a precision at the final wave and accounts for attrition, it does not test whether a value has changed. If the goal is specifically to detect a change between waves with a stated power, use the paired design in
Change in Proportion or
Change in Mean instead.
What can I do to reduce attrition rather than just planning for it?
Regular contact between waves, updated tracking information, small incentives, and multiple contact attempts before recording someone as lost to follow up all tend to reduce attrition more cost effectively than inflating the baseline sample alone.
Does the margin of error apply to every wave or just the last one?
Just the final wave. The calculation works backward from the precision needed at the end of the study to the number that must be enrolled at the start.
Ready to plan your longitudinal study?
Open the Longitudinal tool in AnalyZ Solutions. Free, browser based.
Try it out
Related Guides