Control Sampling in Stata: Question, Controls and Model Are Three Different Things

On this page
อ่านฉบับภาษาไทย (Thai version)
Abstract
The research question, the way controls are sampled and the statistical model are three different things, and confusion about case-control estimates comes from mixing them. A hypothetical cohort of 200 newborns followed to day 28 shows it: 20 of 100 with inadequate antenatal care and 10 of 100 with adequate care had a complication, over 2,440 and 2,660 person-days. The same data give a risk ratio of 2.00, an odds ratio of 2.25 and an incidence rate ratio of 2.18, and none is wrong. A case-control study inherits one of these measures from its controls: non-cases at the end give the odds ratio, everyone at baseline the risk ratio, and people still at risk at each event time a rate ratio. Because a hazard is an instantaneous incidence rate, conditional logistic regression on those risk sets estimates the Cox hazard ratio. This article works through the measures, sampling schemes and Stata commands, ending with three questions to ask before choosing a model.
One cohort of newborns, four ways to analyse it
Imagine following 20,000 newborn babies from birth until 28 days of age. You want to know whether inadequate antenatal care (ANC) is associated with a higher occurrence of neonatal complications.
You could analyse the same population using logistic regression, Poisson regression (a model for event counts relative to time at risk) or Cox regression (the standard model for time to an event). You could also select a smaller group of cases and controls and use conditional logistic regression, which compares each case only with the controls in its own matched set.
At first this seems confusing. Why do different models produce different measures? Why does a case-control study sometimes estimate a risk ratio or an incidence rate ratio (IRR, the ratio of events per unit of time at risk), even though logistic regression reports an odds ratio?
The answer is that the research question, the way controls are sampled, and the statistical model are three different things. Understanding this distinction makes the entire topic easier, and the rest of this article follows it: first the measures, then the sampling, then the models and the Stata commands.
1. Start with one simple question
Suppose we follow 200 newborns for up to 28 days. Half received inadequate ANC, and the other half received adequate ANC. All numbers are hypothetical.
For consistency, babies without an event contribute 28 days, while babies who have an event contribute time until their first event. The average event times are 10 days in the inadequate ANC group and 14 days in the adequate ANC group. The time at risk therefore adds up to 80 × 28 + 20 × 10 = 2,240 + 200 = 2,440 person-days with inadequate ANC, and 90 × 28 + 10 × 14 = 2,520 + 140 = 2,660 person-days with adequate ANC. This sum of the time each baby spent at risk is the person-time.
From this one dataset, we can calculate three different measures.
| Information | Inadequate ANC | Adequate ANC |
|---|---|---|
| Newborns | 100 | 100 |
| Newborns with an event | 20 | 10 |
| Newborns without an event | 80 | 90 |
| Total person-days at risk | 2,440 | 2,660 |
Three measures from the same 200 newborns
-
Risk ratio (RR)
\[ \text{RR} = \frac{20/100}{10/100} = 2.00 \]
Risk asks how many people develop the outcome during the observation period. Inadequate ANC risk = 20/100 = 20%; adequate ANC risk = 10/100 = 10%. Newborns with inadequate ANC have twice the 28-day cumulative risk of the outcome. The denominator is the number of newborns at the beginning of follow-up.
-
Odds ratio (OR)
\[ \text{OR} = \frac{20/80}{10/90} = 2.25 \]
Odds compare the number of people who develop an event with those who do not: 20/80 = 0.25 with inadequate ANC and 10/90 = 0.111 with adequate ANC. The 28-day outcome odds are 2.25 times higher in the inadequate ANC group. Odds are not the same as probabilities, and this is why OR and RR differ: a risk of 0.2 is an odds of 0.2/(1 − 0.2) = 0.25, and a risk of 0.5 is an odds of 1.
-
Incidence rate ratio (IRR)
\[ \text{IRR} = \frac{20/2440}{10/2660} = 2.18 \]
An incidence rate measures how frequently events occur relative to the total time people remain at risk. Inadequate ANC rate = 20/2,440 = 0.00820 events per person-day; adequate ANC rate = 10/2,660 = 0.00376 events per person-day. The incidence rate of the first neonatal event is approximately 2.18 times higher in the inadequate ANC group.
Result: The same 200 newborns produced RR = 2.00, OR = 2.25 and IRR = 2.18.
None of these calculations is automatically wrong. They measure different aspects of the outcome.
2. What makes an incidence rate different from risk?
Consider two newborns. Baby A has a complication on day 5. Baby B remains free of complications throughout the full 28 days. Baby A contributes five person-days before the event; Baby B contributes 28 person-days.
For a 28-day risk analysis, Baby A has an event and Baby B does not. For an incidence rate analysis, we additionally consider that Baby A contributed only five days of time at risk, whereas Baby B contributed 28 days. This is the difference.
Incidence rates are particularly useful when follow-up duration differs between individuals. However, an incidence rate is not a probability. A rate of 0.02 events per person-day does not mean that every person has a 2% cumulative probability of an event during the entire study.
3. What is a hazard ratio?
In general, an incidence rate is the number of events divided by the person-time:
$$\mathrm{IR} = \frac{\text{events}}{\text{person-time}}$$Calculated over all 28 days, this is an average incidence rate. Now shrink the interval step by step until it closes in on a single time $t$. The rate of events among the people still at risk at that moment is called the hazard. A hazard is an instantaneous incidence rate [1]:
$$h(t) = \text{instantaneous incidence rate}$$Imagine asking what happens on day 10 after birth. Rather than examining the entire 28-day follow-up, we focus on newborns who are still at risk immediately before day 10, and we compare how quickly events are occurring in the inadequate and adequate ANC groups at that moment. The hazard ratio is
$$\mathrm{HR}(t) = \frac{\text{hazard in inadequate ANC at time } t}{\text{hazard in adequate ANC at time } t} = \frac{h_1(t)}{h_0(t)} = \text{instantaneous IRR}(t)$$In other words, a hazard ratio is a kind of rate ratio: one that compares event rates at the same instant.
An important distinction follows. An ordinary IRR, calculated from total events divided by total person-time, summarises rates across a follow-up period. A hazard ratio compares rates at the same instant. These quantities can differ because hazards may change over time, and different groups may contribute different amounts of person-time at different stages of follow-up.
If the proportional hazards assumption holds, the hazard ratio is constant over time. For example, if $h_1(t) = 2\,h_0(t)$, then $\mathrm{HR}(t) = 2$ at every follow-up time, conditional on the model covariates: the hazard in the inadequate ANC group is twice that of the adequate ANC group at every moment. This explains why Cox regression is commonly used for time-to-event outcomes. It models $h(t \mid X) = h_0(t)\,e^{\beta X}$, where the baseline hazard $h_0(t)$ may take any shape over time and $e^{\beta}$ is the HR.
Importantly, the overall IRR calculated from total person-time is not guaranteed to equal the Cox HR, even when proportional hazards holds. With $h_1(t) = 2\,h_0(t)$, the overall IRR need not be 2, because it is an average of the rates over the whole follow-up, weighted by each group's person-time. If proportional hazards does not hold, a single value from Cox regression or clogit is a time-weighted summary and may not mean one constant IRR or HR.
4. Why can a case-control study estimate three different measures?
This is one of the most important ideas in case-control methodology. A case-control study, which measures the exposure in the cases and in a sample of controls instead of in everyone, does not necessarily estimate the cohort odds ratio. What it estimates depends on where the controls came from [2, 3]. Three common methods are exclusive, inclusive and concurrent sampling.
We are used to the picture 'case = ill, control = not ill'. That picture is right for exclusive sampling, but it is not the general definition of a control in a case-control study. The more accurate definition is that a control is a sample of the denominator we want to represent. The word control does not mean a healthy person.
So the cases are the same in every design. When the controls change, the denominator they represent changes, and so the effect measure that the case-control odds ratio estimates changes too [4]. These relationships follow the population structure represented by each control sample.
| Sampling method | How controls are selected | Controls represent | Cohort measure targeted |
|---|---|---|---|
| Exclusive | People without the event at the end of follow-up | Non-cases at the end | Odds ratio |
| Inclusive | People sampled from the cohort at baseline, including possible future cases | Everyone at the start | Risk ratio |
| Concurrent | People still at risk when each case has the event | Person-time at risk | Incidence rate ratio (rate or hazard) |
Exclusive sampling
Suppose we identify all newborns who develop complications by day 28. Controls are selected only from newborns who remain event-free at the end of follow-up.
The case-control comparison reproduces the exposure odds among cases relative to non-cases. With representative sampling, the resulting case-control OR estimates the full-cohort OR. This is why ordinary logistic regression is appropriate:
$$\log\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1\,\mathrm{ANC}, \quad e^{\beta_1} = \mathrm{OR}$$Here $p$ is the probability of being a case. Logistic regression does not model $p$ directly; it models the odds, $p/(1-p)$, so it gives an OR. In the commands of this article, case is 1 for a case and 0 for a control, ANC or inadequate_anc is 1 for inadequate antenatal care, and id identifies the newborn. For an exclusive sample the crude and adjusted commands are:
cc case ANC
logistic case ANC
logistic case ANC age SES coverage_gapcc computes the crude OR from a 2 by 2 table, and logistic gives the same crude OR as a regression. They are one idea, not two different models.
Inclusive sampling
Now suppose controls are sampled from everyone at the beginning of follow-up. A newborn selected as a control can subsequently develop the outcome and become a case. Because these controls represent the original population rather than only survivors, the exposure odds ratio from the case-control sample estimates the cohort risk ratio under the appropriate sampling assumptions [2].
Sampling a newborn who later becomes a case is correct. At baseline that newborn was one of the people who make up the denominator of the risk, cases divided by the population at baseline. Becoming a case later is not a problem. The same newborn can then appear twice, once as a control row and once as a case row, because the two rows do different jobs:
id case ANC
15 0 1 <- control
...
15 1 1 <- caseOrdinary logistic regression can still be used. However, two rows from the same newborn are not independent, while ordinary logistic regression treats every row as a different person. Standard errors must account for this dependence, so we cluster by individual ID; rows with the same ID are then allowed to be correlated when the standard error is calculated:
logistic case ANC, vce(cluster id)
logistic case ANC age SES coverage_gap, vce(cluster id)The command is still logistic, and it still computes an odds ratio, the OR of the case-control sample. What that sample OR represents in the cohort depends on the sampling design. Logistic regression has not turned into a risk ratio model: inclusive sampling makes the sample OR estimate the cohort RR.
Same cases, different controls: a cohort of 100
A smaller hypothetical cohort of 100 newborns shows the arithmetic. Of 40 newborns with inadequate ANC, 20 develop the outcome within 28 days; of 60 with adequate ANC, 10 do.
-
The cohort risk ratio
\[ \text{RR} = \frac{20/40}{10/60} = 3.0 \]
The risks are 20/40 = 50% with inadequate ANC and 10/60 = 16.7% with adequate ANC. This is the real cohort, not yet a case-control study.
-
Exclusive controls: the non-cases at day 28
\[ \text{OR} = \frac{20/10}{20/50} = 5.0 \]
At day 28 the non-cases are 20 with inadequate ANC and 50 with adequate ANC. Exclusive controls come from this column, so the comparison is the exposure split of the cases against the exposure split of the non-cases. Inadequate ANC moved many newborns into the case column and left few in the non-case column, which makes the OR large.
-
Inclusive controls: everyone at the start
\[ \frac{20/10}{40/60} = \frac{2}{0.667} = 3 \]
Inclusive controls represent the 40 : 60 split at the start, while the cases are unchanged.
-
Why the inclusive result is the risk ratio
\[ \frac{20/10}{40/60} = \frac{20/40}{10/60} = \frac{\text{risk}_{\text{inadequate}}}{\text{risk}_{\text{adequate}}} = \text{RR} \]
Rearranging the same four numbers puts the risk of each group on the top and the bottom. Inclusive controls represent the number of people who started in each exposure group, so they rebuild the denominator of the risk, cases divided by people at the start.
Result: The same cases give 5.0 with exclusive controls, the cohort OR, and 3.0 with inclusive controls, the cohort RR.
Exclusive controls answer how the exposure odds of the people who developed the outcome compare with those of the people who did not; inclusive controls rebuild the risk.
Concurrent sampling
Concurrent sampling takes a different approach. It does not ask who was there at the start, and it does not ask who was free of the outcome at the end. Every time a newborn develops the outcome, it asks who, at this moment, could still develop it. Investigators identify all other newborns still at risk at that particular time, and a small number of controls are randomly selected from this group.
For a case occurring on day 5, controls come from newborns still at risk on day 5. For a case occurring on day 12, controls come from newborns still at risk on day 12. The people still at risk at a case's event time are its risk set, and each case with its sampled controls forms a matched set.
A control selected on day 5 may later become a case on day 12. This is acceptable, because control status means the newborn was still at risk at the earlier event time.
A timeline of six newborns shows what these controls end up representing:
Day 0 Day 28
|-----------------------------------------------|
1 inadequate ANC ------ X event day 5
2 inadequate ANC ----------- X event day 10
3 inadequate ANC ---------------------------- no event
4 adequate ANC ------------------ X event day 18
5 adequate ANC ---------------------------- no event
6 adequate ANC ---------------------------- no event
Case 1 on day 5: control pool 2 3 4 5 6
Case 2 on day 10: control pool 3 4 5 6
Case 4 on day 18: control pool 3 5 6Newborn 1 cannot be drawn after day 5, because the event has already happened. Newborns 3, 5 and 6 stay event-free to day 28, so they can be chosen as controls in several risk sets, while newborn 1 contributes very little time. The controls therefore represent not the number of people but the time people spend in the risk set: the person-time. They rebuild the denominator of a rate, events divided by person-time, not the denominator of a risk, events divided by people.
The main advantage is that the sampled controls represent the population's time at risk, rather than merely those who remain event-free at the end of follow-up. Consequently, incidence density sampling, another name for concurrent sampling, can estimate a relative incidence rate without requiring the outcome to be rare [4, 5, 6].
5. Why is concurrent sampling called an IRR design if we analyse it with conditional logistic regression?
This is where epidemiology and survival analysis meet. Concurrent sampling is defined as an IRR design by epidemiology, yet when it is analysed with clogit matched on event time, we are estimating a hazard ratio within the framework of survival analysis. These two ideas look like different subjects, but they are directly connected.
The term incidence rate ratio describes the epidemiological comparison that concurrent sampling is designed to recover. The term conditional logistic regression describes the statistical method used to analyse the matched case-control data. They are not competing definitions.
In concurrent sampling, each case is compared with controls who were still at risk at the same event time. This corresponds to comparing instantaneous incidence rates. An instantaneous incidence rate is a hazard. Therefore, the relative incidence rate at time $t$ is mathematically the same quantity as the hazard ratio at time $t$.
The design names the measure; the model reads it
When a common proportional hazards effect is appropriate, conditional logistic regression on the sampled risk sets can estimate the same hazard ratio parameter as Cox regression on the entire cohort [7, 8]. This is the explanation for the apparently contradictory terminology. Concurrent sampling is described as estimating an incidence rate ratio because of the control-sampling design. Conditional logistic regression connects that design to the hazard ratio estimated by Cox regression.
Why do epidemiology texts call it an IRR and not simply an HR? Because they stress that the sampling design decides which measure in the source population a case-control estimate represents [3]. Seen through the statistical model, the same designs read as in the table below.
The distinction to keep is that an instantaneous rate ratio should not automatically be confused with an overall rate ratio calculated from total events divided by total person-time.
| Design | Epidemiologic interpretation | Model | Model-based interpretation |
|---|---|---|---|
| Exclusive sampling | Cohort odds ratio | Logistic | OR |
| Inclusive sampling | Cohort risk ratio | Logistic | RR of the source cohort |
| Concurrent (density) sampling | Incidence rate ratio | clogit on time-matched sets | HR under a proportional hazards model |
| Full cohort, no sampling | Not a case-control design | stcox | HR |
6. Why use conditional logistic regression instead of ordinary logistic regression?
Imagine two risk sets. On day 5, Baby A has an event, and Babies B and C are selected as controls from newborns who remain at risk. On day 12, Baby D has an event, and Babies E and F are selected as controls.
Day 5 Risk set 1: A (case) B, C (controls)
Day 12 Risk set 2: D (case) E, F (controls)Ordinary logistic regression ignores this grouping unless the matching structure is otherwise accounted for. It treats the sampled case-control observations as part of one combined analysis, every case against every control.
Conditional logistic regression explicitly respects the risk-set structure. It compares A against B and C, and D against E and F, and then combines information across risk sets to estimate the exposure association. A case in set 1 is never compared with a control in set 2, because they come from different times.
This matters because the underlying hazard can differ between day 5 and day 12. In model terms, ordinary logistic regression has one intercept, while conditional logistic regression lets each risk set have its own baseline:
$$\operatorname{logit}(p) = \beta_0 + \beta_1 X \quad \text{versus} \quad \operatorname{logit}(p) = \alpha_{\text{set}} + \beta_1 X$$We are not interested in the $\alpha_{\text{set}}$ terms, only in $\beta_1$: how the exposure relates to being the case among people in the same risk set. The conditional likelihood makes each set's intercept drop out [8], so comparing people within the same event time avoids the need to estimate a separate baseline event rate for every sampled risk set. The article on logit, ologit and clogit works the same comparison through matched pairs.
In Stata, the command is:
clogit case i.inadequate_anc, group(_set) orThe variable _set identifies which newborns belong to the same sampled risk set. Conditional logistic regression does not create these sets. They must be constructed when the controls are sampled; clogit only takes matched sets that already exist and compares the case with the controls inside each set:
Full cohort
-> know when each case had the event
-> build the risk set at that case's event time
-> sample controls from that risk set
-> give the case and its controls one set ID
-> clogit uses that set ID in the analysisA separate six-person cohort, with its own letters, shows where the matching happens and how clogit reads each set:
A ANC=1 event day 5
B ANC=0 event day 12
C ANC=1 event day 20
D ANC=0 no event
E ANC=1 no event
F ANC=0 no eventWhen A has the event on day 5, all six are still at risk; A is the case and D and E are sampled as controls. When B has the event on day 12, A has already left the risk set, so the pool is B, C, D, E and F; C and F are sampled. This is where the matching happens, not inside clogit:
set_id person case ANC
1 A 1 1
1 D 0 0
1 E 0 1
2 B 1 0
2 C 0 1
2 F 0 0The model is then told which rows belong together:
clogit case ANC, group(set_id)group(set_id) means that the people in set 1 are compared only with each other, the people in set 2 only with each other, and nobody in set 1 is ever compared with anybody in set 2. Inside each set, the model asks: with one case and several controls, which member, given everyone's exposure, is most likely to be the case? A person with ANC = 1 carries the weight $e^{\beta}$, a person with ANC = 0 carries $e^{0} = 1$, and the probability that person $j$ is the case within the set is
In set 1 the case A has ANC = 1, which supports $\beta > 0$. In set 2 the case B has ANC = 0 while the control C has ANC = 1, which does not. clogit does this for every set and combines the evidence from all of them to estimate $\beta$; that is the matched OR.
In Stata the three steps are three commands with three different jobs. stset tells Stata that these are survival data: what the follow-up time is and what the event is. sttocc samples controls from the risk set at each case's event time. Neither is a model.
Only then does clogit, the model, analyse the matched sample:
stset followup_time, failure(outcome2==1)
sttocc, number(4)
clogit case ANC, group(setid)Although Stata displays an odds ratio, the epidemiological interpretation is a relative incidence rate. Under a suitable proportional hazards model, it is interpreted as an HR.
7. Why does Cox regression provide the full-cohort comparison?
Conditional logistic regression and Cox regression share a closely related likelihood structure [7]. At each event time, Cox regression compares the individual experiencing the event with everyone else still at risk. Concurrent case-control analysis does the same kind of comparison, but uses sampled controls instead of every eligible cohort member. This gives a useful relationship.
| Feature | Concurrent case-control | Full cohort |
|---|---|---|
| Model | Conditional logistic | Cox regression |
| Comparison | Case versus sampled risk set | Case versus full risk set |
| Uses event time | Yes | Yes |
| Target under proportional hazards | HR | HR |
The two commands side by side
Cox regression therefore provides a natural reference analysis when evaluating whether concurrent case-control sampling reproduces the association observed in the full cohort:
* Concurrent Case-Control
clogit case i.inadequate_anc, group(_set) or
* Full Cohort
stset tmorbidity28, failure(morbidity28==1)
stcox i.inadequate_ancThese two commands are compared because both rest on risk-set comparison and can estimate the same relative hazard parameter, under suitable sampling and proportional hazards assumptions. Here morbidity28 is 1 for a newborn with the outcome by day 28 and tmorbidity28 is the time at risk.
The estimates need not be numerically identical, because the case-control analysis uses only a sample of the full risk sets. The primary distinction is efficiency and available information, not a different underlying biological outcome.
8. Where does Poisson regression fit?
Poisson regression can also estimate an incidence rate ratio. For example:
poisson morbidity28 i.inadequate_anc, ///
exposure(tmorbidity28) irr vce(robust)The exposure() option tells Stata to use each newborn's time at risk as the denominator. The model relates the expected number of events to person-time. In simple terms:
Poisson regression then compares incidence rates between the two ANC groups. In the simple two-group example, this produces the ratio of events per total person-time: the IRR of 2.18 from the 200 newborns.
But there is an important limitation. A simple Poisson model using one record per newborn and one total exposure time assumes a rate structure that does not explicitly change over the follow-up period. Cox regression is more flexible, because its baseline hazard can change over time without requiring a specified functional form.
If we divide follow-up into smaller intervals and fit a piecewise Poisson model with interval-specific baseline rates, Poisson regression can approximate Cox regression. Under certain data structures, their relative effect estimates can be equivalent. The correct conclusion is therefore not that Cox is always better than Poisson.
The Poisson command above estimates an overall incidence rate ratio from the total person-time. That is another summary measure, not the most direct comparison for time-matched concurrent sampling. The article on Poisson regression for rates goes further into the model itself.
| Feature | Poisson with offset, time pooled | Concurrent sampling with clogit |
|---|---|---|
| Compares | Average incidence rates | Instantaneous incidence rates |
| Time | Person-time added up over the whole follow-up | Matched at each event time |
| Effect | Overall IRR | HR under proportional hazards |
| Must the two be equal? | Not necessarily | Not necessarily |
9. How do robust and clustered standard errors fit into this?
One final issue often creates confusion. The choice between logistic regression, Poisson regression, conditional logistic regression and Cox regression primarily concerns the estimation model and the target effect. The choice of variance estimator, the rule that gives the standard error, concerns uncertainty.
vce(robust) changes how the model calculates standard errors under certain departures from its variance assumptions, while generally treating observations as independent. vce(cluster id) also allows observations belonging to the same individual to be correlated. Neither option automatically changes an odds ratio into a risk ratio or an incidence rate ratio.
For example, modified Poisson regression, a Poisson model fitted to a binary outcome with robust standard errors, is commonly used to estimate risk ratios [9]. It models the log of the risk, $\log(p) = X\beta$, where logistic regression models the log of the odds, $\log\{p/(1-p)\}$, so $e^{\beta}$ is an RR rather than an OR. The Poisson variance does not fit 0/1 data, which is why vce(robust) is added: it repairs the standard error, not the measure. In the full cohort of 20,000 newborns, the RR and the HR are estimated as:
glm outcome2 ANC age SES coverage_gap, ///
family(poisson) link(log) vce(robust) eform
stset followup_time, failure(outcome2==1)
stcox ANC age SES coverage_gapPoisson regression with person-time exposure, by contrast, estimates incidence rate ratios. The difference in their target measures comes from how the outcome and follow-up time are modelled, not from the word robust. The article on which vce() to use covers the choice of variance estimator.
Four models, and three commands that are not models
| Model | What it asks | What it models | Measure |
|---|---|---|---|
Logistic regression (logistic) | Who has higher odds of being a case? | Log odds | OR |
Conditional logistic regression (clogit) | Within the same matched set, who has higher odds of being the case? | Log odds within each matched set, each with its own intercept | Matched OR; with risk-set controls, an HR |
Modified Poisson regression (glm with family(poisson) link(log) vce(robust)) | Who has a higher risk of the outcome? | Log risk | RR |
Cox regression (stcox) | Among people still at risk at this time, who has the higher hazard? | Log hazard, with a baseline hazard of any shape | HR |
Common misreadings and their fixes
-
"Every case-control odds ratio estimates the same thing."
Stata labels the result of
cc,logisticandclogitan odds ratio whatever the design. In the cohort of 100, the same cases gave 5.0 with exclusive controls and 3.0 with inclusive controls.Fix: Read the estimate from where the controls came from: non-cases at the end give the cohort OR, everyone at baseline gives the cohort RR, and people still at risk at each event time give a rate ratio, read as an HR when the risk sets are analysed with
clogit. -
"A control must be a healthy person, so drop controls who later become cases."
In inclusive and concurrent sampling a control may later become a case. Dropping those newborns leaves only the people still free of the outcome at the end, which turns the design back into exclusive sampling and moves the estimate toward the OR.
Fix: Treat a control as a sample of the denominator. Keep the later cases as controls, and cluster the standard error on
idwhen one newborn appears in two rows. -
Analysing risk sets with ordinary logistic regression
Ordinary logistic regression puts every case and every control into one pool, so a case on day 5 is compared with controls drawn on day 12, when the hazard may be different.
Fix: Use
clogitwithgroup(_set), so each case is compared only with the controls of its own risk set. -
"
clogitdoes the matching."clogitonly reads the set identifier it is given. If the sets were not built from the risk set at each case's event time,clogitcannot repair that.Fix: Build the risk sets when the controls are sampled (
stset, thensttoccor your own risk-set sampling) and pass the set ID toclogit. -
"The overall IRR from Poisson must equal the Cox HR."
The overall IRR averages rates over the whole follow-up, weighted by each group's person-time; the HR compares rates at the same instant. Even when the hazard with inadequate ANC is exactly twice the hazard with adequate ANC at every time, the overall IRR need not be 2.
Fix: Decide first whether the target is an overall IRR (Poisson with person-time) or a time-specific relative hazard (Cox regression, or
clogiton risk sets), and report the estimate under that name. -
"A rate of 0.02 per person-day is a 2% risk."
A rate counts events relative to time at risk. It is not the probability that a person has the event over the study.
Fix: Use risk for the probability of an event within a stated period, and keep rates in events per unit of person-time.
-
"
vce(robust)turns the odds ratio into a risk ratio."The variance estimator concerns uncertainty.
vce(robust)andvce(cluster id)change the standard error, while the measure comes from the model, the outcome, the follow-up time and how the controls were sampled.Fix: Choose the model for the measure first: modified Poisson on a binary outcome in cohort data for an RR, Poisson with person-time for an IRR, logistic regression for an OR. Then choose
vce()for the standard error; the article on which vce() to use covers that choice.
10. A practical guide for clinical researchers
Before choosing a regression model, ask three questions.
First, what do I want to measure?
- If the question concerns the probability of an event within 28 days, consider a risk ratio.
- If it concerns events per person-day, consider an incidence rate ratio.
- If it concerns the hazard of a first event over time, consider a hazard ratio.
Second, what information do I have?
- A binary outcome at the end of follow-up may support a risk-based analysis.
- A dataset with accurate event times and censoring information (when each person's follow-up ended without the event) can support a time-to-event analysis.
- A case-control dataset requires careful identification of its control-sampling strategy.
Third, how were the controls selected?
- If controls are sampled from survivors, the case-control OR estimates the cohort OR.
- If controls are sampled from the baseline population, the case-control OR can estimate the cohort RR.
- If controls are sampled from person-time at risk, the case-control analysis can estimate relative incidence rates.
- When controls are individually matched to cases at event times, conditional logistic regression appropriately handles those matched risk sets.
Conclusion
Logistic regression, conditional logistic regression, Poisson regression and Cox regression are not simply interchangeable ways to analyse a binary outcome. Each method answers a different statistical question or reflects a different sampling design.
Risk ratios compare probabilities. Incidence rate ratios compare event rates per unit of person-time. Hazard ratios compare instantaneous event rates among those who remain at risk.
The central connection is that a hazard is an instantaneous incidence rate. This is why concurrent case-control sampling, described in epidemiology as estimating incidence rate ratios, connects naturally to conditional logistic regression and Cox proportional hazards regression.
The most useful principle is simple, and it starts from the estimand, the precise quantity a study aims to estimate.
Glossary
- person-time (ผลรวมเวลาที่อยู่ในความเสี่ยง)
- The time each person spent under follow-up and at risk, added over people, for example person-days.
- incidence rate
- Events divided by the person-time at risk; it is not a probability.
- incidence rate ratio (IRR) (อัตราส่วนอัตราอุบัติการณ์)
- The ratio of two incidence rates, events per unit of person-time.
- hazard (ฮาซาร์ด)
- An instantaneous incidence rate: the event rate at time t among people still at risk.
- hazard ratio (HR) (อัตราส่วนฮาซาร์ด)
- The ratio of two hazards at the same time; the instantaneous IRR at that time.
- proportional hazards (ข้อสมมติฮาซาร์ดเป็นสัดส่วน)
- The assumption that the hazard ratio stays constant over follow-up time.
- Cox regression (แบบจำลอง Cox)
- A regression for the hazard, h(t | X) = h0(t) e^(βX), whose baseline hazard h0(t) may take any shape; e^β is the HR.
- exclusive (cumulative) sampling (การเลือกกลุ่มควบคุมแบบสะสม)
- Drawing controls from people without the event at the end of follow-up; the case-control OR estimates the cohort OR.
- inclusive (case-base) sampling (การเลือกกลุ่มควบคุมจากฐานประชากรทั้งหมด)
- Drawing controls from everyone at baseline, including possible future cases; the case-control OR estimates the cohort RR.
- concurrent (risk-set) sampling (การสุ่มกลุ่มควบคุมจากกลุ่มเสี่ยง)
- Drawing controls from the people still at risk at each case's event time; the controls represent person-time.
- incidence density sampling (การเลือกกลุ่มควบคุมตามความหนาแน่นของอุบัติการณ์)
- Another name for concurrent (risk-set) sampling.
- risk set
- The people still at risk at the moment a case has the event.
- matched set (ชุดที่จับคู่)
- One case together with the controls sampled for it, identified by a set ID such as _set.
- conditional logistic regression (conditional logistic regression)
- Logistic regression with its own intercept for each matched set, fitted so that each case is compared only with the controls in its own set (clogit in Stata).
- Poisson regression
- A model for event counts relative to time at risk; with person-time as the exposure, it estimates an IRR.
- modified Poisson regression (Poisson ดัดแปลง)
- A Poisson model with a log link fitted to a binary outcome with robust standard errors, used to estimate a risk ratio in cohort data.
- estimand (ปริมาณเป้าหมายของการประมาณ)
- The precise quantity a study aims to estimate.
References
- Vandenbroucke JP, Pearce N. Case-control studies: basic concepts. Int J Epidemiol. 2012;41(5):1480-1489. doi:10.1093/ije/dys147 https://doi.org/10.1093/ije/dys147
- Pearce N. What does the odds ratio estimate in a case-control study? Int J Epidemiol. 1993;22(6):1189-1192. doi:10.1093/ije/22.6.1189 https://doi.org/10.1093/ije/22.6.1189
- Knol MJ, Vandenbroucke JP, Scott P, Egger M. What do case-control studies estimate? Survey of methods and assumptions in published case-control research. Am J Epidemiol. 2008;168(9):1073-1081. doi:10.1093/aje/kwn217 https://doi.org/10.1093/aje/kwn217
- Rodrigues L, Kirkwood BR. Case-control designs in the study of common diseases: updates on the demise of the rare disease assumption and the choice of sampling scheme for controls. Int J Epidemiol. 1990;19(1):205-213. doi:10.1093/ije/19.1.205 https://doi.org/10.1093/ije/19.1.205
- Greenland S, Thomas DC. On the need for the rare disease assumption in case-control studies. Am J Epidemiol. 1982;116(3):547-553. doi:10.1093/oxfordjournals.aje.a113439 https://doi.org/10.1093/oxfordjournals.aje.a113439
- Richardson DB. An incidence density sampling program for nested case-control analyses. Occup Environ Med. 2004;61(12):e59. doi:10.1136/oem.2004.014472 https://doi.org/10.1136/oem.2004.014472
- Langholz B, Goldstein L. Risk set sampling in epidemiologic cohort studies. Stat Sci. 1996;11(1):35-53. doi:10.1214/ss/1032209663 https://doi.org/10.1214/ss/1032209663
- Breslow NE, Day NE. Statistical Methods in Cancer Research, Volume I: The Analysis of Case-Control Studies. IARC Scientific Publications No. 32. Lyon: International Agency for Research on Cancer; 1980. https://publications.iarc.who.int/Book-And-Report-Series/Iarc-Scientific-Publications/Statistical-Methods-In-Cancer-Research-Volume-I-The-Analysis-Of-Case-Control-Studies-1980
- Zou G. A modified Poisson regression approach to prospective studies with binary data. Am J Epidemiol. 2004;159(7):702-706. doi:10.1093/aje/kwh090 https://doi.org/10.1093/aje/kwh090
Key takeaways
- The research question, the way controls are sampled and the statistical model are three different things; keeping them apart removes most of the apparent contradictions.
- One cohort of 200 newborns gives an RR of 2.00, an OR of 2.25 and an IRR of 2.18; none is wrong, because each uses a different denominator: people at the start, people without the event, or person-time.
- A control is a sample of the denominator: controls from non-cases at the end estimate the cohort OR, controls from everyone at baseline estimate the cohort RR, and controls from the people still at risk at each event time estimate a rate ratio.
- A hazard is an instantaneous incidence rate, so clogit on risk sets estimates the same HR as Cox regression on the full cohort, while Poisson with person-time estimates an overall IRR that need not equal it.
- Choose the epidemiological question and estimand first, then the model; vce(robust) or vce(cluster id) changes the standard error, never the measure.
Related in the wiki: [[nested-case-control-design]] [[logit-ologit-clogit-one-link-three-questions]] [[choosing-vce-robust-cluster-standard-errors]]