8.3 Retrospective Sampling

So far we have assumed that the data are i.i.d. draws from a population of interest. But in some settings, such as studying a rare disease, sampling the population as it is would require a very large sample—thousands or millions of observations—which is highly inefficient.

Instead, we draw a balanced sample from patients with the disease and from healthy controls; say \(50\) individuals in each group. When we later evaluate the model on a test sample from the original population, the class balance will not match the \(50\)–\(50\) split used in training.

 

To address this in the model, define a random variable \(Z\) indicating whether an individual was sampled. The sampling scheme leads us to work with \[P(Y=1 \mid Z=1, X=x)\] rather than \(P(Y=1 \mid X=x)\). In the logistic regression framework, write \[r_0 = P(Z=1 \mid Y=0), \qquad r_1 = P(Z=1 \mid Y=1).\] Then \[\begin{align*} P(Y=1 \mid Z=1, X=x) &= \frac{P(Z=1 \mid Y=1,x)\, P(Y=1 \mid x)}{P(Z=1, Y=0 \mid x) + P(Z=1, Y=1 \mid x)}\\ &= \frac{r_1 \exp(\alpha + x^T \beta)}{r_0 + r_1 \exp(\alpha + x^T \beta)}\\ &= \frac{\exp(\alpha^* + x^T \beta)}{ 1 + \exp(\alpha^* + x^T \beta)}, \end{align*}\] where \(\alpha^* = \alpha + \log\frac{r_1}{r_0}\). Although the data were sampled retrospectively, the logistic model still applies, with the same slope coefficients \(\beta\) and a different intercept.