11 Design and Analysis of Case-Control and Case-Cohort studies
An investigation that involves selecting representative groups of those having and not having a characteristic is expensive and time consuming, however, and is rarely if ever used. Actual practice in the field is to take two groups presumed to be representative of persons who do and do not have the disease and determine the percentage in each group who have the characteristic. Thus rather than determine the percentage of smokers and nonsmokers who have cancer of the lung, one determines the percentage of persons with and without cancer of the lung who are smokers. (Cornfield 1951)
In a cohort study, we select participants based on exposure \(X\) and follow them over time to ascertain the occurrence of disease \(D\). When the disease is rare or when the time to disease onset is long, estimating a measure of association might take a large cohort or a long follow-up period. Because we have selected based on exposure, the study is powered to estimate the association between \(X\) and any disease outcome. However, it may not be better than a random sample from the population for looking the association between a different exposure \(X'\) and disease outcomes. When there is no clear hypothesis about the cause of a disease, it can be difficult to select a useful cohort based on exposure.
The case-control study was one of the great innovations in epidemiology in the 20th century (Nigel Paneth, Susser, and Susser 2002; Nigl Paneth, Susser, and Susser 2002). In a case-control study, we select participants based on disease outcome \(D\) and then measure their exposure \(X\). This study design is powered to estimate the association between \(D\) and any exposure, which makes it useful for rare diseases and common exposures or for a disease for which there is no clear hypothesis about its causes. It was the study design that was used to establish that smoking causes lung cancer (Doll and Hill 1950), aspirin causes Reyes syndrome (Hurwitz et al. 1987), and that prenatal exposure to diethylstilbestrol causes vaginal clear-cell adenocarcinoma (Herbst, Ulfelder, and Poskanzer 1971). In each case, there was a rare or slowly-developing disease and no clear hypothesis about its causes.
While case control studies are more efficient than cohort studies with the same total number of participants for rare diseases and common exposures (see Section 7.5), they have less flexibility in the choice of a measure of association. The odds ratio in a case-control study approximates the risk ratio or hazard ratio from a hypothetical cohort study in the same population (Pearce 1993) However, data from a case-control study can be used to estimate absolute risks or rates if there is additional information such as the sampling fraction of cases, the total size of the population giving rise to the cases and controls, or the overall incidence of disease (Miettinen 1976). Case-control studies are often retrospective, and retrospective studies can be more susceptible to differential misclassification (e.g., recall bias) and selection bias than prospective studies (see Section 8.2.3).
11.1 Case-control studies for rare diseases
In case-control studies, the odds raito for exposure comparing cases to controls approximates the risk ratio or the incidence rate ratio that would be calculated from a large cohort study in the population from which the cases and control are sampled.
11.1.1 Cumulative case-control studies and the odds ratio
In a cumulative case-control study, controls are sampled from the people in the population who do not have disease. Using the notation from Table 2.1, the risk ratio comparing the exposed to the unexposed is \[ \RR = \frac{a / r_1}{c / r_0} = \frac{a / c}{r_1 / r_0}. \tag{11.1}\] The final expression is an odds ratio because the numerator is the odds of exposure among the cases and the denominator is the odds of exposure in the entire cohort. This use of the odds ratio to approximate the risk ratio was first proposed by Cornfield (1951).1 When the disease is rare in both exposure groups in a cohort study, \(a \ll r_1\) and \(c \ll r_0\) so \[ \frac{r_1}{r_0} \approx \frac{r_1 - a}{r_0 - c} = \frac{b}{d}. \] Therefore, \[ \RR = \frac{a / r_1}{c / r_0} \approx \frac{a / c}{b / d} = \OR_X \] so the odds ratio for exposure comparing those with \(D = 1\) (cases) to those with \(D = 0\) (controls) approximates the risk ratio for disease comparing the exposed to the unexposed.
The odds ratio comparing cases to controls can be calculated in a case-control study, where we select participants based on disease status. From Section 9.1.2, the variance of the log risk ratio is \[ \Var\bigl(\ln \RR\bigr) = \frac{1}{a} - \frac{1}{r_1} + \frac{1}{c} - \frac{1}{r_0} \approx \frac{1}{a} + \frac{1}{c} \tag{11.2}\] when the risks of disease \(p_1\) and \(p_0\) are both small. Thus, the precision of the risk ratio estimate in a large cohort study with a rare disease is determined almost entirely by the number of cases in each exposure group. Instead of recruiting a large population and waiting for cases to occur, it is more efficient to recruit cases directly, measure their exposure, and compare their exposure odds to those of a sample of controls.
The variance of the log odds ratio is \[ \Var\bigl(\ln \OR\bigr) = \frac{1}{a} + \frac{1}{b} + \frac{1}{c} + \frac{1}{d}. \tag{11.3}\] If we recruit \(k\) controls per case, then \[ \Var\bigl(\ln \OR\bigr) = \frac{1}{a} + \frac{1}{k a} + \frac{1}{c} + \frac{1}{k c} = \bigg(1 + \frac{1}{k}\bigg) \bigg(\frac{1}{a} + \frac{1}{c}\bigg). \tag{11.4}\] Let \(\sigma_{\text{cc}}\) be the standard error the \(\ln \RR\) estimated via the \(\ln \OR\) from a case-control study with \(k\) controls per case, and let \(\sigma_{\text{cohort}}\) be the standard error of the estimated \(\ln \RR\) from a large cohort study with a rare disease. Comparing Equation 11.2 and Equation 11.4, we get \[ \sigma_\text{cc} \approx \sigma_\text{cohort} \sqrt{1 + \frac{1}{k}}. \tag{11.5}\] Figure 11.1 plots this function. A case-control study with \(k = 5\) has about 10% higher standard error than a full cohort study, and a case-control study with \(k = 10\) has about 5% higher standard error. In practice, most case-control studies recruit 3–5 controls per case.
casecontrol-cumulative.R
## Cumulative case-control study
# The rats data is from:
# Mantel, Bohidar, and Ciminera (1977). Cancer Research 37: 3863-3868.
library(survival) # rats data
# estimate rsk ratio from cohort study with log-binomial regression
# Risk calculations are valid because follow-up is complete over 104 weeks.
cohort_RR <- glm(status ~ rx, data = rats, family = binomial(link = "log"))
exp(coef(cohort_RR)) # estimated risk ratio = 2
exp(confint(cohort_RR)) # 95% confidence interval (1.14, 3.51)
# sample controls from rats who did not have incidence tumors
# We will use 4 controls per case and sample without replacement.
ncase <- sum(rats$status)
rat_id <- 1:nrow(rats)
controls <- sample(rat_id[rats$status == 0], 4 * ncase)
# combine case and control data
casedat <- subset(rats, status == 1)
controldat <- rats[controls, ]
ccrats <- rbind(casedat, controldat)
# logistic regression model for exposure in cases and controls
# The exposure odds ratio comparing cases and controls approximates the RR.
# In the case-controls data, status = 1 for cases and status = 0 for controls.
ccx <- glm(rx ~ status, data = ccrats, family = binomial())
exp(coef(ccx))
exp(confint(ccx))
# logistic regression model for case/control status in exposed and unexposed
# By symmetry of the odds ratio, we can switch exposure and outcome.
# The estimated odds ratio is the same, but the intercepts are different.
ccd <- glm(status ~ rx, data = ccrats, family = binomial())
exp(coef(ccd))
exp(confint(ccd))
# case-control / cohort coefficient standard error ratio
# With 4 controls per case, it is approximately sqrt(1 + 1 / 4) = 1.12.
sqrt(vcov(cohort_RR)[2, 2]) # log risk ratio SE in cohort study
sqrt(vcov(ccd)[2, 2]) # log odds ratio SE in case-control study
sqrt(vcov(ccd)[2, 2] / vcov(cohort_RR)[2, 2])11.1.2 Density case-control studies and risk-set sampling
The cumulative case-control design implicitly assumes complete follow-up (so that it is possible to sample from the entire non-diseased population at the end of follow-up). In a density case-control study, the odds ratio for exposure is meant to approximate the incidence rate ratio \(\IRR\). The name comes from the use of incidence density to refer to an incidence rate. If we have \(a\) cases from \(T_1\) units of person-time among the exposed and \(c\) cases from \(T_0\) units of person-time among the unexposed, the incidence rate ratio is \[ \IRR = \frac{a / T_1}{c / T_0} = \frac{a / c}{T_1 / T_0}. \tag{11.6}\] The numerator is the odds ratio for exposure among the cases, and the denominator is the odds ratio for exposure among units of person-time.
In risk set sampling (sometimes called incidence density sampling), controls are sampled from the risk set at each failure time. As described in Section 6.2.1, the risk set \(\mathcal{R}(t)\) consists of all participants at risk of an observed event at time \(t\). This produces a set of controls with an exposure odds \(b / d\) approximately equal to \(T_1 / T_0\) when each group has exponential times to events (as assumed by the use of incidence rates—see Section 5.3.2) and the prevalence of exposure does not change over time (Miettinen 1976). When these assumptions are approximately correct, \[ \IRR \approx \frac{a / c}{b / d} = \OR_X \] so the odds ratio for exposure comparing cases to controls approximates the incidence rate ratio for disease comparing the exposed to the unexposed. From Section 9.1.4, \[ \Var\bigl(\ln \IRR\bigr) = \frac{1}{a} + \frac{1}{c}. \] In a density case-control study, the same control can be selected for multiple cases, and a person who is selected as a control can later become a case. If the disease is rare, there will be little or no overlap between cases and controls, so the variance of the estimated \(\ln \OR\) when we recruit \(k\) controls per case is given by Equation 11.4. Then relationship in Equation 11.5 and Figure 11.1 holds if \(\sigma_{\text{cc}}\) is the standard error the estimated \(\ln \IRR\) from a density case-control study and \(\sigma_{\text{cohort}}\) is the standard error of the estimated \(\ln \RR\) from a large cohort study.
In a closed cohort, the prevalence of exposure will stay approximately constant only under the null hypothesis of no exposure-disease association or when the risk of disease over the follow-up period is small in both exposure groups. For rare diseases with exponential times to events, \[ \RR = \frac{1 - e^{-\lambda_1 t}}{1 - e^{-\lambda_0 t}} \approx \frac{\lambda_1}{\lambda_0} = \IRR \] where \(\lambda_1\) is the incidence rate in the exposed and \(\lambda_0\) is the incidence rate in the unexposed. Thus, the incidence rate ratio estimated by a density case-control study of a rare disease is also an approximation to the risk ratio from a large cohort study. The approximation to the risk ratio from a density case-control study is generally more accurate than that of a cumulative case-control study (Greenland and Thomas 1982). The reason for this can be seen in Figure 11.2, where the contours for the incidence rate ratio (which is a special case of the hazard ratio) are closer to the risk ratio contours than the odds ratio contours are. These are the same contour lines shown in Figure 9.3, but they are plotted together and we have zoomed in to the bottom left corner.
Code
RRapprox.R
## Approximation to the risk ratio in case-control studies
# contour labels
require(plotrix, quietly = TRUE)
# odds, logistic, and cumulative hazard functions
odds <- function(p) p / (1 - p)
invodds <- function(odds) odds / (1 + odds)
cumhaz <- function(p) -log(1 - p)
# Rothman diagram with RR, OR, and HR contours
riskratios <- c(0.2, 0.5, 2, 5)
p0 <- seq(0.0001, 0.11, by = 0.001)
plot(p0, p0, type = "l", col = "darkgray", xlim = c(0, 0.1), ylim = c(0, 0.1),
xlab = "Risk in the unexposed", ylab = "Risk in the exposed")
grid()
for (riskratio in riskratios) {
p1 <- riskratio * p0
# risk ratio contours
lines(p0, riskratio * p0, lty = "solid")
# odds ratio contours
lines(p0, invodds(riskratio * odds(p0)), lty = "dashed")
# cumulative hazard ratio contours
lines(p0, 1 - (1 - p0)^riskratio, lty = "dotted")
# labels
boxed.labels(0.1 / (riskratio + 1), 0.1 * riskratio / (riskratio + 1),
as.character(riskratio),
xpad = 1.62, ypad = 1.62, border = FALSE)
}
legend("topright", bg = "white", lty = c("solid", "dotted", "dashed"),
legend = c("Risk ratio", "Hazard ratio", "Odds ratio"))casecontrol-density.R
## Density case-control study
# The rats data is from:
# Mantel, Bohidar, and Ciminera (1977). Cancer Research 37: 3863-3868.
library(survival) # rats data and survreg()
# estimate incidence rate ratio from cohort study with exponential AFT model
# The estimated incidence rate ratio is exp(-beta_rx).
cohort_IRR <- survreg(Surv(time, status) ~ rx, data = rats,
dist = "exponential")
exp(-coef(cohort_IRR))
exp(-confint(cohort_IRR))
# function to sample controls for each case
control_sample <- function(id, k) {
# id should be a rat who has an event
if (rats$status[id] == 0) stop("Rat ", id, " did not have a tumor.")
t <- rats$time[id]
# possible controls are riskset minus individuals with events at time t
rat_id <- 1:nrow(rats)
controlset <- rat_id[with(rats, (time > t) | (time == t & status == 0))]
# sample up to k controls
if (length(controlset) > 1) {
ksamp <- min(length(controlset), k)
controls <- sample(controlset, ksamp)
} else {
controls <- NULL
}
controls
}
control_sample(1, 4) # no tumor
control_sample(2, 4) # returns sampled control ids
# generate case-control data for one case
cc_set <- function(id, k) {
controls <- rats[control_sample(id, k), ]
controls$status <- 0
ccdat <- rbind(rats[id, ], controls)
# use case id to identify case-control set
ccdat$case <- id
# return data for case-control set
ccdat
}
cc_set(1, 4)
cc_set(2, 4)
# generate density case-control data
# We are recruiting k = 4 controls per case in each risk set.
# The same control could be chosen more than once, and
# a control could later become a case.
cases <- rat_id[rats$status == 1] # rats with incident tumors
ccrats <- do.call(rbind, lapply(cases, cc_set, k = 4))
# estimate the incidence rate ratio with logistic regression
# The exposure odds ratio comparing cases and controls approximates the IRR.
ccx <- glm(rx ~ status, data = ccrats, family = binomial())
exp(coef(ccx))
exp(confint(ccx))
# logistic regression model for case/control status in exposed and unexposed
# By symmetry of the odds ratio, we can switch exposure and outcome.
# The estimated odds ratio is the same, but the intercepts are different.
ccd <- glm(status ~ rx, data = ccrats, family = binomial())
exp(coef(ccd))
exp(confint(ccd))
# case-control / cohort coefficient standard error ratio
# With 4 controls per case, it is approximately sqrt(1 + 1 / 4) = 1.12.
sqrt(vcov(cohort_IRR)[2, 2]) # log incidence rate ratio SE in cohort study
sqrt(vcov(ccd)[2, 2]) # log odds ratio SE in case-control study
sqrt(vcov(ccd)[2, 2] / vcov(cohort_IRR)[2, 2])11.2 Case-cohort studies
From Equation 11.1, the risk ratio for disease comparing the exposed to the unexposed is equal to the odds ratio for exposure comparing the cases to the entire cohort. In a case-cohort study, the odds ratio for exposure in the cohort is approximated using the odds ratio for exposure in a random sample of the cohort (Kupper, McMichael, and Spirtas 1975). This random sample is called the subcohort. Members of the subcohort are allowed to become cases, but all cases must come from within the original cohort.
Let \(a_\text{s}\) denote the number of exposed cases that come from the subcohort, and let \(a_\text{x}\) denote the number of exposed cases that come from outside the subcohort. Similarly define \(c_\text{s}\) and \(c_\text{x}\) be the number of unexposed cases from inside and outside the subcohort, respectively. Then \(a = a_\text{s} + a_\text{x}\) is the total number of exposed cases and \(c = c_\text{s} + c_\text{x}\) is the total number of unexposed cases. The total number of cases from the subcohort is \[ k_{1 \text{s}} = a_\text{s} + c_\text{s}, \] and the total number of cases outside the subcohort is \[ k_{1 \text{x}} = a_\text{x} + c_\text{x}. \] The total number of cases is \[ k_1 = a + c = k_{1 \text{s}} + k_{1 \text{x}}. \] The \(b\) exposed controls and \(d\) unexposed controls are all within the subcohort, and the total number of controls is still \(k_0 = b + d\). Table 11.1 shows a 2x2 table adapted to the case-cohort design.
| Cases | Noncases | Subcohort | Study Sample | |
|---|---|---|---|---|
| \(X = 1\) | \(a = a_\text{x} + a_\text{s}\) | \(b\) | \(r_{1\text{s}} = a_\text{s} + b\) | \(r_1 = a + b\) |
| \(X = 0\) | \(c = c_\text{x} + c_\text{s}\) | \(d\) | \(r_{0\text{s}} = c_\text{s} + d\) | \(r_0 = c + d\) |
| Total | \(k_1 = k_{1\text{x}} + k_{1\text{s}}\) | \(k_0\) | \(n_\text{s}\) | \(n\) |
In the notation of Table 11.1, \[ \RR_D \approx \frac{a / c}{r_{1\text{s}} / r_{0\text{s}}} \tag{11.7}\] where the last expression is the odds ratio for exposure comparing the cases to the entire subcohort. The variance calculation for the \(\ln \OR\) from a case-cohort study must account for overlap between the cases and the subcohort. When there is no overlap, \(r_{1\text{s}} = b\) and \(r_{0\text{s}} = d\) so the variance of the \(\ln \OR\) in Equation 11.3 is correct.
11.2.1 Rare diseases with rare exposures
Section 7.5 showed that a cohort study is the most powerful design for detecting a lack of independence between a rare exposure and a common disease, where \(\pi (1 - \pi) < p (1 - p)\) where \(\pi\) is the marginal prevalence of exposure and \(p\) is the marginal prevalence of disease. For a common exposure and a rare disease, where \(\pi (1 - \pi) > p (1 - p)\), a case-control study is the most powerful design for detecting a lack of independence. The case-cohort design can be efficient when you have a rare exposure and a rare disease: You can sample a cohort by exposure to ensure adequate sample sizes in both exposure groups, and you can sample by disease within the cohort to ensure there are enough cases without following the entire cohort. Sampling by both exposure and disease seems to invite selection bias, but this is prevented by taking cases only within the cohort and by using the odds ratio to approximate the risk ratio as in Equation 11.7.
11.2.2 Estimation without the rare disease assumption*
When there is overlap between the cases and the subcohort, it is possible to get a more efficient estimator of the risk ratio than the estimator in Equation 11.7. To avoid selection bias, the selection of cases within the cohort must be independent of exposure status, so \[ \Pr\bigl(\text{in subcohort} \,\big|\, \text{case}, X = x\bigr) = \Pr(\text{in subcohort} \given{} \text{case}). \] The maximum likelihood estimate of the common probability of being in the subcohort given becoming a case is \[ \hat{\Pr}\bigl(\text{in subcohort} \,\big|\, \text{case}\bigr) = \frac{a_\text{s} + c_\text{s}}{a + c}. \] Using this common probability gives us \[ \tilde{a}_\text{s} = a \times \hat{\Pr}\bigl(\text{in subcohort} \,\big|\, \text{case}\bigr) = \frac{a (a_\text{s} + c_\text{s})}{a + c} \] expected exposed cases in the subcohort and \[ \tilde{a}_\text{x} = a \times \hat{\Pr}\bigl(\text{outside subcohort} \,\big|\, \text{case}\bigr) = \frac{a (a_\text{x} + c_\text{x})}{a + c} \] expected exposed cases outside the subcohort. The total number of exposed cases inside and outside of the subcohort is unchanged because \[ \tilde{a}_\text{s} + \tilde{a}_\text{x} = \frac{a \big((a_\text{s} + c_\text{s}) + (a_\text{x} + c_\text{x})\big)}{a + c} = a, \] but the corresponding number of exposed controls is \[ \tilde{r}_1 = \tilde{a}_\text{s} + b. \] The expected number of unexposed cases inside and outside the subcohort is calculated in the same way, leaving the total number of unexposed cases unchanged but altering the number of unexposed members of the subcohort. Table 11.2 shows the adjusted case-cohort 2x2 table.
| Cases | Noncases | Subcohort | Study Sample | |
|---|---|---|---|---|
| \(X = 1\) | \(a = \tilde{a}_\text{x} + \tilde{a}_\text{s}\) | \(b\) | \(\tilde{r}_{1\text{s}} = \tilde{a}_\text{s} + b\) | \(r_1 = a + b\) |
| \(X = 0\) | \(c = \tilde{c}_\text{x} + \tilde{c}_\text{s}\) | \(d\) | \(\tilde{r}_{0\text{s}} = \tilde{c}_\text{s} + d\) | \(r_0 = c + d\) |
| Total | \(k_1 = \tilde{k}_{1\text{x}} + \tilde{k}_{1\text{s}}\) | \(k_0\) | \(\tilde{n}_\text{s}\) | \(n\) |
The estimated risk ratio comparing the exposed to the unexposed is approximated by the odds ratio for exposure comparing cases to the adjusted subcohort: \[ \hat{\RR}_\text{Sato} = \frac{a / c}{\tilde{r}_{1\text{s}} / \tilde{r}_{0\text{s}}}. \tag{11.8}\] The variance for Wald hypothesis tests and confidence intervals is calculated on the log scale: \[ \Var\bigl(\ln \hat{\RR}_\text{Sato}\bigr) = \frac{1}{a} + \frac{1}{c} + \frac{k_{1\text{x}} - k_{1\text{s}}}{k_1} \bigg(\frac{1}{\tilde{r}_{1\text{s}}} + \frac{1}{\tilde{r}_{0\text{s}}}\bigg) - \frac{n^2 k_{1\text{x}} k_{1\text{s}} a c}{k_1^3 \tilde{r}_{1\text{s}}^2 \tilde{r}_{0\text{s}}^2} \tag{11.9}\] This analysis of a case-cohort study spans the range from a cumulative case-control study (when all cases occur outside the subcohort) to a cohort study (when the subcohort is the entire cohort).
11.2.2.1 All cases outside the subcohort: cumulative case-control study
When the disease is sufficiently rare that all cases occur outside the subcohort, we have \(k_{1\text{s}} = 0\) and \(k_{1\text{x}} = k_1\). Thus, \(\tilde{a}_s = \tilde{c}_\text{s} = 0\). Plugging these into Equation 11.8, we get the estimated risk ratio \[ \hat{\RR}_\text{Sato} = \frac{a / c}{\tilde{r}_{1\text{s}} / \tilde{r}_{0\text{s}}} = \frac{a / c}{b / d}, \] which is the odds ratio from a cumulative case-control study. Plugging these into Equation 11.9, we get \[ \Var\bigl(\ln \hat{\RR}_\text{Sato}\bigr) = \frac{1}{a} + \frac{1}{c} + \frac{1}{\tilde{r}_{1\text{s}}} + \frac{1}{\tilde{r}_{0\text{s}}} = \frac{1}{a} + \frac{1}{c} + \frac{1}{b} + \frac{1}{d}, \] which the large-sample variance of the log odds ratio from Equation 11.3. Thus, the case-cohort point and interval estimates of the risk ratio match those of the cumulative case-control study in Section 11.1.1.
11.2.2.2 All cases in the subcohort: cohort study
When the subcohort includes the entire cohort, we have \(k_{1 \text{x}} = 0\) and \(k_{1 \text{s}} = k_1\), so \(\tilde{a}_\text{s} = a\) and \(\tilde{c}_\text{s} = c\). It follows that \(\tilde{r}_{1\text{s}} = r_1\) and \(\tilde{r}_{0\text{s}} = r_0\). Plugging these into Equation 11.8, we get the estimated risk ratio \[ \hat{\RR}_\text{Sato} = \frac{a / c}{\tilde{r}_{1\text{s}} / \tilde{r}_{0\text{s}}} = \frac{a / r_1}{c / r_0}, \] which is the estimated risk ratio from a cohort study. Plugging these into Equation 11.9, we get \[ \Var\bigl(\ln \hat{\RR}_\text{Sato}\bigr) = \frac{1}{a} + \frac{1}{c} - \frac{1}{\tilde{r}_{1\text{s}}} - \frac{1}{\tilde{r}_{0\text{s}}} = \frac{1}{a} - \frac{1}{r_1} + \frac{1}{c} - \frac{1}{r_0}, \] which the large-sample variance of the log risk ratio from Section 9.1.2. Thus, the case-cohort point and interval estimates of the risk ratio match those of a cohort study.
11.3 Nested case-control studies
The nested case-control study is a generalization of the density case-control study that relaxes the assumption of constant hazards of failure. It was first used to study lung cancer among asbestos miners in Quebec (Liddell, McDonald, and Thomas 1977; Thomas 1977). Let \(X_j\) denote the exposure status of person \(j\). The Cox partial likelihood for the log hazard ratio \(\beta\) is \[ L(\beta) = \prod_{i = 1}^m \frac{e^{\beta X_i})}{\sum_{j \in \mathcal{R}(t_i)} e^{\beta X_j}}, \] where \(t_1 < t_2 < \ldots < t_m\) are the distinct failure times, person \(i\) is the person who fails at time \(t_i\), and \(\mathcal{R}(t)\) is the risk set at time \(t\) as in Section 10.4. In a nested case-control study, each risk set \(\mathcal{R}(t_i)\) is replaced by a sample \(R^*(t_i)\) that includes the individual who had an event and a random sample of other members of \(R(t_i)\). The Cox partial likelihood becomes \[ L(\beta) = \prod_{i = 1}^m \frac{e^{\beta x_i}}{\sum_{j \in \mathcal{R}^*(t_i)} e^{\beta x_j}}. \tag{11.10}\] By the same logic that led to the Cox partial likelihood for a cohort study, the likelihood contribution at each event time \(t_i\) is the conditional probability that an event occurred in individual \(i\) given that an event occurred in the matched case-control set \(\mathcal{R}^*(t_i)\) (Oakes 1981). Maximum likelihood estimation yields consistent and asymptotically normal point and interval estimates for \(\hat{\beta}\) without any rare disease assumption (Borgan, Goldstein, and Langholz 1995).
Let \(\hat{\beta}_\text{cc}\) be the maximum partial likelihood estimate from a nested case-control study and \(\hat{\beta}_\text{cohort}\) be the maximum partial likelihood estimate from the full cohort. When \(\beta = 0\) and there are \(k\) controls sampled per case, \[ \Var(\hat{\beta}_\text{cc}) \approx \bigg(1 + \frac{1}{k}\bigg) \Var(\hat{\beta}_\text{cohort}) \] which is the same relationship that held for the cumulative case-control study versus a full cohort study in Figure 11.1. When \(\beta \neq 0\), the relative efficiency of a nested case-control study can be somewhat lower than this. However, this efficiency can be improved using more sophisticated strategies of sampling from the risk sets.
11.3.1 Conditional logistic regression
A nested case-control study can be analyzed using conditional logistic regression, which produces the partial likelihood in Equation 11.10 using the matched case-control sets (Breslow et al. 1978). To see the connection with the logistic regression model (i.e., a binomial generalized linear model with a logit link), consider a matched set with one case and \(k\) controls and let \(p_j\) the risk of disease in person \(j\). Then the probability that there is one failure and no other failures is \[ \sum_{i = 1}^{k + 1} \bigg(p_i \prod_{j \neq i} (1 - p_j) \bigg) = \sum_{i = 1}^{k + 1} \frac{p_i}{1 - p_i} \prod_{j = 1}^{k + 1} (1 - p_j). \] Without loss of generality, we can number the group members so that person one is the case. The probability that person one is the case given that there is one failure in the group is \[ \frac{\frac{p_1}{1 - p_1} \prod_{j = 1}^{k + 1} (1 - p_j)}{\sum_{i = 1}^k \frac{p_i}{1 - p_i} \prod_{j = 1}^{k + 1} (1 - p_j)} = \frac{\odds(p_1)}{\sum_{i = 1}^{k + 1} \odds(p_j)} \tag{11.11}\] where \(\odds(p_j) = p_j / (1 - p_j)\) is the odds corresponding to \(p_j\). Let \(\odds(p_{ij})\) be the odds of disease for person \(j\) in the matched case-control set \(\mathcal{R}^*_i\) where person \(i\) is the case. Then the conditional logistic regression model assumes \[ \logit(p_{ij}) = \ln \odds(p_{ij}) = \beta_{0i} + \beta x_j, \] where \(\beta_{i0}\) is an intercept specific to \(\mathcal{R}^*_i\) and \(x_j\) is the covariate for person \(j\). When there are \(m\) distinct event times, the likelihood for \(\beta\) in the conditional logistic regression model is \[ L(\beta) = \prod_{i = 1}^m \frac{e^{\beta_{0i} + \beta x_i}}{\sum_{j \in \mathcal{R}^*(t_i)} e^{\beta_{0i} + \beta x_j}} = \prod_{i = 1}^m \frac{e^{\beta x_i}}{\sum_{j \in \mathcal{R}^*(t_i)} e^{\beta x_j}}, \tag{11.12}\] which is exactly the same as the Cox partial likelihood for the nested case-control study in Equation 11.10. The intercept cancels out just like the unspecified baseline hazard. Point and interval estimates of \(\beta_\true\) can be calculated using maximum likelihood estimation or Bayesian methods. The estimated hazard ratio comparing the exposed to the unexposed is \(e^{\hat{\beta}}\), and confidence limits or credible limits for the hazard ratio can be obtained by exponentiating the confidence limits or credible limits for \(\beta_\true\).
casecontrol-nested.R
## Nested case-control study and conditional logistic regression
# The rats data is from:
# Mantel, Bohidar, and Ciminera (1977). Cancer Research 37: 3863-3868.
library(survival) # rats data and clogit() function
# estimate hazard ratio from cohort study using Cox model
cohort_HR <- coxph(Surv(time, status) ~ rx, data = rats)
exp(coef(cohort_HR))
exp(confint(cohort_HR))
# function to sample controls for each case
control_sample <- function(id, k) {
# id should be a rat who has an event
if (rats$status[id] == 0) stop("Rat ", id, " did not have a tumor.")
t <- rats$time[id]
# possible controls are riskset minus individuals with events at time t
rat_id <- 1:nrow(rats)
controlset <- rat_id[with(rats, (time > t) | (time == t & status == 0))]
# sample up to k controls
if (length(controlset) > 1) {
ksamp <- min(length(controlset), k)
controls <- sample(controlset, ksamp)
} else {
controls <- NULL
}
controls
}
control_sample(1, 4) # no tumor
control_sample(2, 4) # returns sampled control ids
# generate case-control data for one case
cc_set <- function(id, k) {
controls <- rats[control_sample(id, k), ]
controls$status <- 0
ccdat <- rbind(rats[id, ], controls)
# use case id to identify case-control set
ccdat$case <- id
# return data for case-control set
ccdat
}
cc_set(1, 4)
cc_set(2, 4)
# generate nested case-control data
# We are recruiting k = 4 controls per case.
cases <- rat_id[rats$status == 1] # rats with incident tumors
ccrats <- do.call(rbind, lapply(cases, cc_set, k = 4))
# estimate hazard ratio with conditional logistic regression
nested_ccd <- clogit(status ~ rx + strata(case), data = ccrats)
exp(coef(nested_ccd))
exp(confint(nested_ccd))
# estimate hazard ratio with conditional logistic regression
# As in standard logistic regression, exposure and disease can be switched.
nested_ccx <- clogit(rx ~ status + strata(case), data = ccrats)
exp(coef(nested_ccx))
exp(confint(nested_ccx))
# case-control / cohort coefficient standard error ratio
# With 4 controls per case, it is approximately sqrt(1 + 1 / 4) = 1.12.
sqrt(vcov(cohort_HR)[2, 2]) # log hazard ratio SE in cohort study
sqrt(vcov(nested_ccd)[2, 2]) # log odds ratio SE in case-control study
sqrt(vcov(nested_ccd)[2, 2] / vcov(cohort_IRR)[2, 2])Jerome Cornfield (1912–1979) was an American statistician who spent most of his career at the National Cancer Institute. He joined the US Bureau of Labor Statistics during the Great Depression and took math and statistics courses at the US Department of Agriculture. He combined the case control data of Doll and Hill (1950) and National Institutes of Health data to calculate the risk of lung cancer among smokers, and he showed that this strong association could not plausibly be explained by any known source of bias. He also helped design the Framingham Heart Study, a large cohort study of risk factors for heart disease that begain in 1948.↩︎

