Sampling/
Case-Control Study
Sample Size Estimation, Other Study Designs
How to Calculate Sample Size for a Case-Control Study
A case-control study compares exposure rates between people who have an outcome and similar people who do not. This guide explains the underlying statistics first, then shows how to apply them using AnalyZ Solutions.
6 min read
Sample Size Estimation
Intermediate
A case-control study compares people who already have an outcome, the cases, with similar people who do not, the controls, looking backward to identify factors associated with the outcome. It is a common design in health research, especially when the outcome is rare or has already occurred by the time the study begins. This guide first explains what a case-control study is and when it applies, then the general formula behind the calculation, then walks through how to apply it in AnalyZ Solutions.
01What a case-control study is, and when it applies
A case-control study starts from the outcome rather than from the exposure. Researchers identify a group of people who already have the outcome of interest, the cases, and a comparison group of similar people who do not, the controls. They then look backward, comparing how common a suspected exposure or risk factor was in each group. If the exposure was meaningfully more common among cases than among controls, this is evidence of an association between the exposure and the outcome.
This is the reverse of a cohort or cross-sectional design, which starts from exposure status and looks forward to see who develops the outcome. A case-control study is a strong fit when three conditions hold together.
- The outcome is rare. Following a large enough cohort forward in time to observe enough cases of a rare outcome can require an impractically large and long study. Starting from people who already have the outcome sidesteps this problem entirely.
- The outcome has a long delay between exposure and onset. Waiting years or decades for a cohort study to observe outcomes is often infeasible. A case-control study can examine an association that took a long time to develop without waiting for it to develop again.
- Cases can be reliably identified, and a suitable comparison group of controls can be found. Cases are often identified through clinical records, registries, or diagnosis. Controls should come from the same underlying population that produced the cases, so that the only systematic difference between the groups is, ideally, exposure status.
Why this design is efficient for rare or slow-developing outcomes
The core efficiency of a case-control study is that it does not require observing the natural occurrence of the outcome in a large population over time. A cohort study of a disease that affects 1 in 10,000 people would need to follow an enormous number of people, for years, to accumulate enough cases to analyse. A case-control study instead identifies a workable number of cases directly, for example from hospital records, and compares them with an appropriate number of controls, dramatically reducing the sample size and time needed to detect a real association, at the cost of the specific limitations described below.
Common pitfalls
- Selecting controls that are not representative of the population that produced the cases. If controls are recruited in a way that makes them systematically different from cases in ways connected to the exposure, unrelated to the outcome itself, the comparison is biased. This is one of the most consequential and common design errors in case-control studies.
- Recall bias. Because exposure is often measured by asking participants to recall past behaviour or history, cases, who are often more motivated to explain their condition, may recall or report exposure differently than controls. This can create or exaggerate an apparent association that does not reflect a true difference in exposure.
- Reverse causation. Because the design looks backward from an existing outcome, it can be difficult to establish that the exposure preceded the outcome rather than resulted from it, or from an early, undiagnosed stage of it.
- Treating an unmatched analysis as though it were matched, or the reverse. The Kelsey formula used here assumes an unmatched design. A study that individually matches each case to one or more controls on characteristics such as age or sex requires a different, conditional logistic regression approach to sample size, not this one.
02The general sample size formula
Case-control is defined by binary case and control status, so the calculation works with a binary exposure and an odds ratio, using the Kelsey formula.
ncases = (Z1−α/2√((1+1/k)p̄q̄) + Z1−β√(p₁q₁+p₀q₀/k))2 / (p₁−p₀)2
The exposure rate among cases is derived from the exposure rate among controls and the odds ratio you want to be able to detect:
p₁ = (OR × p₀) / (1 − p₀ + OR × p₀)
Each symbol plays a specific role, and setting each one correctly matters for the result to be meaningful.
- Z1−α/2 (confidence level). How sure you want to be that a detected association is real, rather than random noise, at 95% confidence this is 1.96.
- Z1−β (power). How likely you want to be to actually detect the association, if it is really there, at 80% power this is approximately 0.84.
- p₀ (exposure rate in controls). Your best estimate of how common the exposure is in the population that is not affected by the outcome. This should come from prior studies, surveillance data, or a pilot, in a population similar to the one being studied.
- OR (odds ratio). The minimum association strength the study is built to detect, expressed as how many times more likely exposure is among cases than among controls, in odds terms. An odds ratio of 2 means the odds of exposure are twice as high among cases as among controls.
- k (controls per case). How many controls are recruited for each case. Increasing k increases power for the same number of cases, but with diminishing returns.
How to set the odds ratio you want to detect
The odds ratio should reflect the smallest association that would be considered meaningful for the question at hand, not the largest association the researcher hopes to find. An odds ratio of 1.2, a weak association, requires a much larger study than an odds ratio of 3, a strong one, to detect with the same confidence and power. Where prior literature exists on a similar exposure and outcome, use it as a starting point. Where nothing is known, a moderate odds ratio, such as 2, is a common planning default, but should be adjusted to reflect what is actually plausible and relevant for the specific question being studied.
How to set confidence level and power in practice
95% confidence and 80% power are conventional defaults, appropriate for most studies with no specific reason to depart from them.
- Raise power to 90% when the study addresses a potential health risk where missing a real association could have serious public health consequences.
- Tighten confidence below 0.05 before a conclusion that would lead to a costly or hard to reverse recommendation, such as a clinical practice change or a product withdrawal.
Undermining either value carries a real cost. A confidence level set too low increases the risk of reporting an association that is actually just noise. Power set too low means a genuine association has a meaningful chance of going undetected, an outcome that is difficult to distinguish afterward from there being no association at all. Once data collection is complete, there is no way to fix this after the fact.
Choosing how many controls per case
One to four controls per case is typical. Each additional control increases power, but the gain shrinks quickly beyond a ratio of about four to one. Beyond that point, recruiting additional cases is usually a more efficient use of the same effort than recruiting further controls, particularly when cases are not much harder to identify than controls.
One-tailed or two-tailed
The formula above uses Z1−α/2, the two-tailed critical value, appropriate when testing for an association in either direction, a harmful or a protective effect. A one-tailed test, appropriate only when the direction of any true association is known in advance and the opposite direction is of no interest, uses Z1−α instead, producing a smaller required sample for the same nominal confidence level. Two-tailed is the safer, more conventional default for most case-control studies, since the direction of an association is often exactly what the study is trying to establish.
Accounting for cluster sampling
If cases or controls are sampled by cluster, for example recruited from a sample of clinics rather than individually across an entire population, a design effect should be applied. It defaults to 1, meaning no clustering effect, and is always editable. See the dedicated guide on Design Effect and ICC for how to set this correctly.
This tool assumes a binary exposure. If the exposure is continuous, for example comparing mean age or income between cases and controls, that is a different comparison, equivalent to a two-sample t-test, found under Power Analysis rather than here.
How to Calculate This in AnalyZ Solutions
- Set your confidence level and power. Enter both as numbers, not from a fixed list. 95% confidence and 80% power are reasonable defaults unless the study addresses a high stakes decision that justifies tightening either value, as discussed above.
- Enter the exposure rate among controls. Your best estimate of how common the exposure is in people who do not have the outcome, ideally drawn from surveillance data, a prior study in a similar population, or a pilot. This is the baseline against which the odds ratio is applied to derive the implied exposure rate among cases.
- Enter the odds ratio you want to be able to detect. This should reflect the smallest association that would be considered meaningful for the question at hand, not the strongest association you hope to find. A larger odds ratio is easier to detect statistically and requires fewer cases, so an optimistic assumption here is a common way case-control studies end up underpowered in practice.
- Set the number of controls per case. One to four is typical. Each additional control increases power, but the gain shrinks quickly beyond a ratio of about four to one, at which point recruiting additional cases is usually a more efficient use of the same effort.
- Set your expected non-response rate. This inflates the recruitment target for both cases and controls so that, after accounting for people who cannot be reached or decline to participate, you still end up with enough completed cases and controls to meet the statistical minimum.
- Choose one-tailed or two-tailed. Two-tailed is selected by default and tests for an association in either direction, harmful or protective. Reserve one-tailed testing for the rare case where the direction of any true association is known in advance and the opposite direction genuinely does not need to be detected.
- Set a design effect, if cases or controls are sampled by cluster. For example, if they are recruited from a sample of clinics rather than individually across an entire population. Enter a design effect directly, or calculate one automatically from an intraclass correlation and average cluster size. It defaults to 1, meaning no clustering effect, and is always editable.
- Calculate. The result shows the minimum cases needed, the number of controls to recruit at your chosen ratio, both inflated for non-response, the implied exposure rate among cases derived from your odds ratio, and the exact formula used.
Watch calculating sample size for a case-control study in the AnalyZ Solutions interface
03Worked example
A study is assessing a possible risk factor for a health outcome. Exposure among controls is estimated at 20%, and the study should be able to detect an odds ratio of 2.5, using two controls per case, at 95% confidence and 80% power, two-tailed.
Inputs
Confidence level95%
Power80%
Exposure rate in controls20%
Odds ratio to detect2.5
Controls per case2
Non-response rate10%
Test typeTwo-tailed
~77
cases to recruit, 154 controls, incl. non-response
Before the non-response adjustment, the minimum statistical requirement is about 69 cases and 138 controls. The 10% non-response rate inflates both figures so the study still ends with enough completed cases and controls after accounting for people who cannot be reached or decline to participate.
04Common mistakes to avoid
- Assuming more controls always helps proportionally. Gains beyond about four controls per case are small, and additional cases are usually a more efficient use of the same budget.
- Using this formula for a matched design. The Kelsey formula assumes an unmatched design. Matched case-control studies require a conditional logistic regression approach instead.
- Forcing a continuous exposure into this tool. If exposure is continuous rather than binary, use the two-sample t-test tool under Power Analysis instead.
- Forgetting to inflate for non-response. The minimum statistical requirement and the actual recruitment target are different numbers. Recruiting only the minimum, with no allowance for people who cannot be reached or decline, risks ending the study short of both cases and controls.
- Selecting controls from a different underlying population than the cases. Controls should be drawn from the same population that produced the cases. Convenience samples of controls that differ systematically from the case population, for example healthier or more accessible, are a common source of bias that a larger sample size cannot fix.
Frequently Asked Questions
When is a case-control study the right choice, rather than a cohort or cross-sectional design?
When the outcome is rare, when there is a long delay between exposure and outcome, or when a forward-looking cohort study would be impractically large, slow, or costly. See
Sample Size for a Cross-Sectional Survey for the forward-looking alternative when the outcome is common enough to estimate directly.
What if my study is matched, for example each case paired with a control of the same age and sex?
This tool assumes an unmatched design. For a matched case-control study, sample size should be calculated using a conditional logistic regression approach, which accounts for the matching directly.
How many controls per case should I use?
One to four is typical. Power gains beyond a ratio of about four to one are small, so beyond that point it is usually more efficient to recruit additional cases rather than additional controls.
Can I detect a protective association, an odds ratio below 1, with this tool?
Yes. Enter the odds ratio as a value below 1, for example 0.5, and the calculation proceeds the same way.
What is the biggest source of bias to watch for in a case-control study?
Selecting controls who are not representative of the population that produced the cases. If controls differ systematically from cases in ways connected to the exposure, but unrelated to the outcome, the comparison is biased regardless of how large the sample is. Recall bias, where cases and controls report past exposure differently, is a second common concern, particularly when exposure is measured by self-report rather than a record.
Where do I get a realistic exposure rate for controls if no prior data exists?
Surveillance data, prior studies in a similar population, or a small pilot are all reasonable sources. Where genuinely nothing is known, consider running the calculation at a few plausible exposure rates to see how sensitive the required sample is to this assumption before finalising a study plan.
Ready to size your study?
Open the Case-Control tool in AnalyZ Solutions. Free, browser based, your data never leaves your device.
Try it out
Related Guides