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.

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

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 p₀ is the exposure rate among controls. p₁ is the implied exposure rate among cases, derived from the odds ratio. k is the number of controls per case.

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.

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.

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
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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

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