Case-control study
Why a case-control study yields an odds ratio and never an incidence rate, what matching actually buys, and how one real analysis nearly credited the right finding to the wrong cause.
Reverse the direction and the quantities change
A case-control study starts at the outcome: first find people who have already had the event (cases), then find people who have not (controls), then look back and compare the exposure history of the two groups.
That direction is what makes it good at the situations a cohort study cannot handle — rare diseases, where a cohort would have to follow tens of thousands of people to accumulate a handful of events, and diseases with long latency. The price is that it cannot estimate incidence.
The reason is direct: the ratio of cases to controls is chosen by the investigator (1:1, 1:2 and 1:4 are all common). The denominator is a design decision, so every quantity built on a denominator — incidence, relative risk, absolute risk reduction, NNT — is unobtainable. What can be computed is the odds ratio (OR).
The example in this chapter
We use infert, which ships with base R: a matched case-control study of secondary infertility with 83 cases and 165 controls, matched 1:2 on age, parity and education, giving 83 matched sets. The research question is whether induced abortion is associated with secondary infertility.
Start with the 2x2 table the way intuition suggests:
| Case | Control | |
|---|---|---|
| Any induced abortion | 36 | 69 |
| None | 47 | 96 |
The crude OR is 1.07 (95% CI 0.63–1.82) — the interval crosses 1, so this did not reach statistical significance.
Nothing to see, apparently. But this table has two problems, and they do not weigh the same.
What matching does, and what it does not
Matching happens while the controls are being selected: each control is chosen to agree with its case on the specified variables. Here those are age, parity and education.
The purpose is efficiency — the groups start out balanced on those variables, so the analysis does not have to rely on adjusting for them afterwards. But matching has a consequence that is easy to overlook:
The right approach is conditional logistic regression, which compares within each matched set and then pools the information across sets.
A comparison we nearly got wrong
At this point the textbook move would be to write “there — ignore the matching and you get the wrong answer”, and put up a pair of numbers to prove it. We nearly did exactly that. Here is what the analysis actually returns:
| Model | OR | 95% CI | p |
|---|---|---|---|
| Ordinary logistic regression (matching ignored) | 1.07 | 0.63–1.82 | 0.815 |
| Conditional logistic regression (same variables) | 1.09 | 0.61–1.97 | 0.764 |
| Conditional logistic regression + number of spontaneous abortions | 4.15 | 1.78–9.68 | 0.001 |
The first two rows are nearly identical. Respecting the matched structure moves the OR from 1.07 to 1.09, and the interval still crosses 1. What actually turns the conclusion around is the third row: once the number of spontaneous abortions enters the model, the OR jumps to 4.15 (1.78–9.68) and reaches statistical significance.
Why spontaneous abortion matters so much here
Because it is the strongest candidate confounder here: spontaneous abortion and secondary infertility often arise from the same underlying reproductive problem. Put it in the model and the adjusted association between induced abortion and secondary infertility moves from 1.09 to 4.15.
In these data the women with more induced abortions do have fewer spontaneous ones. But that negative correlation has at least three possible sources, and the data cannot separate them. It may reflect a common cause running opposite to the exposure, which is the combination that flattens a real association. It may be an artefact of the design: infert matches on parity, and once parity is fixed the two abortion counts are confined to a narrow total, so more of one forces fewer of the other. Or both may influence selection into the study at all, which is a collider structure. Choosing between the three takes knowledge of reproductive physiology and of the sampling mechanism, not this table.
It also explains why the crude 2x2 table showed nothing — it sets every confounder aside. The 2x2 table of a case-control study is almost never the final answer; it is where you start.
Biases specific to the design
Selection bias: where the controls came from
Controls have to come from the same source population as the cases — meaning that had they developed the disease, this study would have captured them as cases.
Hospital controls (other inpatients) are convenient, but they are in hospital for some other disease, and that disease may itself be related to the exposure. Take lung cancer cases and match them to COPD controls and both groups are full of smokers, so the effect gets diluted. Community controls represent the source population better, but recruitment is harder and the study costs more.
Recall bias
The exposure history is obtained by asking after the fact. People who are ill try harder to remember — they are looking for an answer to “why did this happen to me” — so exposure reporting is often more complete among cases than controls, and that alone manufactures an association.
Mitigations: use objective records (charts, prescriptions, registries) rather than questionnaires, and keep the interviewer blind to whether the respondent is a case or a control.
Reverse causation
Did the exposure really come first? In a case-control study the sequence is often inferred from memory or from records. Early symptoms that change behaviour — feeling unwell and therefore exercising less — end up looking like “inactivity causes the disease”.
Some more advanced variants
| Design | How it works | When to use it |
|---|---|---|
| Nested case-control | Inside an existing cohort, controls are sampled from those still at risk at the moment each case occurs | The cohort already exists, but some assay is too expensive to run on everyone |
| Case-cohort | A random subcohort is drawn at the outset and serves as the comparison group for several outcomes | Several outcomes are to be studied at once |
| Self-controlled case series | Each person is their own control; exposed periods are compared with unexposed periods | To eliminate every personal characteristic that does not change over time (genotype, constitution, socioeconomic position) |
In the first two, the controls are drawn from a defined cohort, so selection bias and recall bias are both greatly reduced — and because that parent cohort’s denominators are known, incidence can be estimated.
How the controls were sampled also decides what the odds ratio is estimating, which is the part most often skipped. With risk-set (density) sampling — the nested design above, where each case’s controls come from the people still at risk at the moment that case occurred — the OR estimates the incidence rate ratio, and needs no rare disease assumption at all. With case-cohort sampling it estimates the risk ratio. It is only cumulative sampling — controls taken from those still free of the disease at the end of follow-up, which is the classical design this chapter has been describing — that yields an OR needing the rare disease assumption of section one. “The disease is rare, so the OR can be read as a risk ratio” is therefore a statement about one particular way of choosing controls, not a general property of case-control studies.
Running it yourself
library(survival)
data(infert)
infert$abortion <- factor(
ifelse(infert$induced > 0, "Induced abortion", "None"),
levels = c("None", "Induced abortion")
)
# ❌ Matching ignored
glm(case ~ abortion, data = infert, family = binomial)
# ✅ Matching respected, exactly the same variables as above -- so that the
# comparison differs in one thing only
clogit(case ~ abortion + strata(stratum), data = infert)
# ✅ Now also control for spontaneous abortions (the step that actually
# changes the conclusion)
clogit(case ~ abortion + spontaneous + strata(stratum), data = infert)Verified with R 4.6.0 and survival 3.8.6. infert ships with base R, so no package needs installing.
import statsmodels.api as sm
from statsmodels.discrete.conditional_models import ConditionalLogit
infert = sm.datasets.get_rdataset("infert").data
infert["abortion"] = (infert["induced"] > 0).astype(int)
# ❌ Matching ignored
naive = sm.Logit(infert["case"], sm.add_constant(infert[["abortion"]])).fit()
# ✅ Matching respected, same variables
cond = ConditionalLogit(infert["case"], infert[["abortion"]],
groups=infert["stratum"]).fit()
# ✅ Now also control for spontaneous abortions
cond_adj = ConditionalLogit(infert["case"],
infert[["abortion", "spontaneous"]],
groups=infert["stratum"]).fit()Python's support for conditional logistic regression is thinner; statsmodels' ConditionalLogit works, but its diagnostics are less complete than R's clogit.
Common misuses
| Misuse | Why it is wrong |
|---|---|
| Reporting an incidence rate or an RR from a case-control study | The denominator was chosen by the investigator; only an OR is available |
| Reading an OR as an RR when the disease is not rare | The OR systematically exaggerates the effect |
| Analysing matched data with ordinary logistic regression | The matched structure is thrown away, the standard errors are wrong, and the association matching created is left in place; conditional logistic regression is the method |
| Claiming that ignoring the matching always understates the effect | The direction of the bias depends on how the matching variable relates to exposure and outcome; it is not guaranteed |
| Trying to estimate the effect of a matching variable | Within a matched set it is identical by construction, so it drops out of the conditional likelihood |
| Concluding confounding because the adjusted OR got bigger | Non-collapsibility moves a conditional OR further from 1 even when there is no confounding at all |
| Using hospital controls without asking why they are admitted | Selection bias, and the usual direction is dilution of the effect |
| Asking about exposure by questionnaire without blinding | Recall bias manufactures an association |
| Attributing a difference to one thing when two models differ in several | A comparison has to differ in one thing, or the attribution is wrong |
| Closing the case because the crude 2x2 table was not significant | In a case-control study the 2x2 table is the start, not the end; no confounder has been handled yet |
Reproducing every number on this page
/opt/homebrew/bin/Rscript figures/scripts/D2-case-control-infert.RRead the figure
The answer comes from the same statistical output that produced this page's figures, not from a number typed in beside them.
Comparing the unconditional logistic regression that ignores matching directly with the conditional model that also adds spontaneous abortions yields the conclusion that ignoring the matching made you miss a real association. What is wrong with it?
Show the answer and why
Correct answer: It skips the middle row. With the same variables and only the matched structure restored, the odds ratio is 1.09, nearly identical to the unmatched fit
Those two models differ in two things at once: whether the matched structure is restored, and whether spontaneous abortions are controlled for. To attribute the difference to one of them, the comparison has to differ only in the other, and that is what the middle row is for. What actually happens is that the estimate moves from 1.07 to 1.09, so the matched structure barely touches the point estimate, and what flips the conclusion is the 4.15 that appears once spontaneous abortions enter. None of that makes ignoring the matching harmless: it distorts the standard error and the interval, and the direction of the bias depends on how the matching variables relate to the exposure and to the outcome, so it is not guaranteed to point toward the null. All it means is that in this dataset the difference was not the matching.
This study enrolled 83 cases and 165 controls, a ratio the investigators fixed at 1 to 2. What does that do to what can be computed?
Show the answer and why
Correct answer: It matters. The total of 248 was assembled by the investigators and corresponds to no population, so only the odds ratio survives
A case-control study starts from the outcome, and the ratio of cases to controls is chosen by the investigators, so the total of 248 corresponds to no population at all. The denominator is manufactured, which strips meaning from everything built on a denominator: incidence, risk ratio, absolute risk reduction, number needed to treat. What remains estimable is the odds ratio. The 83 cases do set the precision, but that is a separate question: whether a quantity can be computed and how precisely are not the same thing. The 165 controls are equally real people; what is not real is the idea that their chance of entering the study was governed by natural incidence. Note also that reading a classical odds ratio as a risk ratio still needs the rare-disease assumption, whereas under risk-set sampling the odds ratio estimates an incidence rate ratio directly.
The intuitive 2 by 2 table gives a crude odds ratio whose confidence interval crosses the null. Can the analysis stop here?
Show the answer and why
Correct answer: No. The crude odds ratio of 1.07 sets every confounder aside, which makes it a starting point rather than an answer
The crude table handles no confounder at all, and the strongest candidate confounder in this dataset, the number of spontaneous abortions, moves the odds ratio from around 1.07 to more than four times the null the moment it enters the model. So 1.07 is not evidence of no association; it is evidence that the analysis has not started. The upper bound of 1.82 cannot be used to rule anything out either: it is the largest association this dataset can hold, and something close to a doubling is not negligible. The same goes for the lower bound of 0.63. An interval spanning the null means the data cannot yet tell the direction, not that the effect is small. The 2 by 2 table of a case-control study is almost never the final answer.
Adding the number of spontaneous abortions to the conditional logistic model moves the odds ratio for induced abortion sharply. Is that enough to establish spontaneous abortion as a confounder?
Show the answer and why
Correct answer: No. A move to 4.150 is large enough that non-collapsibility alone struggles to explain it, but calling something a confounder rests on assumptions about causal structure
At least two things move an odds ratio when a variable is added. One is that real confounding has been controlled. The other is non-collapsibility: even with no confounding whatever, a conditional odds ratio from a logistic model sits further from the null than the marginal one as soon as the added variable is related to the outcome. Moving from 1.094 to 4.150 is a large shift that non-collapsibility struggles to explain on its own, but saying so is a judgement, not something the table states. The p value of 0.001 is even weaker as evidence: it answers how far this estimate sits from the null, which is a different question from whether the previous estimate was biased. The middle answer treats significance as a precondition for an estimate being usable, which is a separate misreading. What is compared here is the movement between two point estimates, and that does not depend on either of them reaching significance; 1.094 being non-significant only means its interval covers the null, not that the number cannot serve as a baseline. Held to that standard, every confounding diagnostic built on how far a coefficient moves when a variable is added would stop working, and those diagnostics ignore significance on purpose, precisely because the unadjusted estimate is so often non-significant to begin with. Calling a variable a confounder in the causal sense needs timing, a causal diagram, a view on unmeasured confounding and on how people were selected, none of which is in the coefficients.
This study matched 1 to 2 on age, parity and education across 83 matched sets. Can the conditional logistic model also tell us whether age is associated with secondary infertility?
Show the answer and why
Correct answer: No. Age is identical within each of these 83 matched sets by construction, so it drops straight out of the conditional likelihood
Matching holds age fixed inside every matched set, and conditional logistic regression compares within those sets, so age has no variation across the 83 strata and drops out of the conditional likelihood. That is not a defect of the model; it is the price of matching. The age distribution of 248 people is still in the file, but that distribution was manufactured by the matching rather than drawn from the source population, and the ages of the 165 controls were picked to match the cases, so treating them as a population distribution reads an artefact of the design as nature. This dataset therefore cannot answer whether age is associated with secondary infertility, which is a limitation of this design with this analysis rather than a claim that age can never be studied.
In the row of the 2 by 2 table for having had an induced abortion, there is one number in the case column and one in the control column. What does comparing those two cells across the row represent?
Show the answer and why
Correct answer: Nothing. With 36 cases against 69 controls, their ratio is an artefact of the enrolment ratio
Comparing the case column with the control column across a row compares the enrolment ratio the investigators chose, not any quantity that occurs in nature. What has to be computed is the odds within each column, 36 against 47 among the cases and 69 against 96 among the controls, and then the ratio of those two odds. 47 and 96 are real cells, but their denominators are groups that were selected, so any risk or incidence built on them does not exist in the world outside the study. That is precisely why case-control studies report an odds ratio: the cells are real, the denominators are not.
Methods used in this chapter
Watch next
Case-Control Studies: A Brief Overview
Case-control study explained
Principles of Epidemiology 08. Case-Control Study 1: Principles
Principles of Epidemiology 09. Case-Control Study 2: M-H Methods & Selection BiasSources and licences
- STROBE Statement: Strengthening the Reporting of Observational Studies in EpidemiologyCC BYThe section order follows the STROBE items. The prose is an original rewrite.