Tutorials › Generalized Linear Models › Covariate-Dependent Control Selection

Case-Control and Sampling Designs · Tutorial 969 of 981

Covariate-Dependent Control Selection

Learn how covariate-dependent selection changes case-control slopes and how a known selection-probability ratio can be incorporated into a likelihood to recover source-population effects.

Advanced 11 min read

What You'll Learn

  • Derive the sampled outcome odds from source-population odds and inclusion probabilities
  • Relate the sampled case and control exposure distributions to the source distributions
  • Identify when a covariate-dependent selection mechanism changes logistic slopes
  • Fit a selection-adjusted logistic model using a known log selection-probability ratio as an offset
  • Recognize when fixed case-control quotas require a design-appropriate likelihood
  • Distinguish slope correction from recovery of population risks or the intercept

Why Control Selection Can Change a Slope

In case-control sampling, cases and controls are selected from a source population. If controls are easier to recruit at some covariate values than others, the controls' exposure distribution no longer represents the source population's exposure distribution among noncases. This matters for a logistic slope: the sampled association between outcome and covariates can contain both the source-population association and the association induced by selection.

The key quantity is not just the probability of selecting controls. It is the ratio of case to control inclusion probabilities at each covariate value. When the logarithm of this ratio varies linearly with the covariates, it shifts the sampled logistic coefficients by a known amount. When that ratio is known, it can be incorporated into a likelihood as an offset; when it is unknown, the source slope and selection effect generally cannot be separated from the sampled data alone.

Definition: Let \(Y\in\{0,1\}\) be the outcome and \(X\in\mathbb{R}^p\) the covariate vector in the source population. Write \(S=1\) if an individual is included in the study, and define \(s_y(x)=P(S=1\mid Y=y,X=x)\). The selection ratio is \(r(x)=s_1(x)/s_0(x)\), where both probabilities are positive. Assume the source model is \(P(Y=1\mid X=x)=\operatorname{expit}(\alpha+\beta^\mathsf{T}x)\), with \(\operatorname{expit}(u)=e^u/(1+e^u)\).

The selection probabilities may depend on the outcome as well as the covariates. The calculation below assumes that, conditional on \(Y\) and \(X\), selection has probability \(s_y(x)\); it does not depend on further unmodelled features related to the outcome. Positivity, \(0<s_y(x)\leq 1\), is needed wherever source-population effects are to be recovered.

How Selection Changes the Sampled Odds

For a person with covariates \(x\), the source-population odds of being a case are \(P(Y=1\mid X=x)/P(Y=0\mid X=x)\). Among selected people with those covariates, the case probability is proportional to the source case probability times the case inclusion probability. The corresponding statement holds for controls.

Theorem: Under the source logistic model and the selection mechanism above, $$ \frac{P(Y=1\mid X=x,S=1)}{P(Y=0\mid X=x,S=1)} = \exp(\alpha+\beta^\mathsf{T}x)\frac{s_1(x)}{s_0(x)}. $$ Thus, wherever the probabilities are positive, $$ \operatorname{logit}P(Y=1\mid X=x,S=1) = \alpha+\beta^\mathsf{T}x+\log r(x). $$

Proof. By conditional probability, the selected case probability is \(P(Y=1\mid X=x,S=1)=P(S=1\mid Y=1,X=x)P(Y=1\mid X=x)/P(S=1\mid X=x)\). The same denominator appears for the selected control probability. Dividing these two expressions cancels that denominator and gives $$ \frac{P(Y=1\mid X=x,S=1)}{P(Y=0\mid X=x,S=1)} = \frac{s_1(x)P(Y=1\mid X=x)}{s_0(x)P(Y=0\mid X=x)} = \exp(\alpha+\beta^\mathsf{T}x)\frac{s_1(x)}{s_0(x)}. $$ Taking logarithms proves the log-odds expression. \(\square\)

If \(\log r(x)=\gamma_0+\gamma^\mathsf{T}x\), the selected-sample model is logistic with intercept \(\alpha+\gamma_0\) and slope \(\beta+\gamma\). Therefore, a standard logistic regression of outcome on covariates in the selected sample does not in general estimate the source slope. If the selection ratio is known, subtract its linear coefficient from the sampled slope. The familiar preservation of slopes under case-control sampling is the special case in which \(r(x)\) is constant in \(x\).

Worked Example: Binary Exposure and Unequal Control Inclusion

Suppose \(X\in\{0,1\}\), and the source-population outcome model has intercept \(\alpha=\log(1/9)\) and slope \(\beta=\log 3\). Cases are included with probability \(s_1(0)=s_1(1)=0.4\). Controls are included with probability \(s_0(0)=0.2\) and \(s_0(1)=0.1\). Find the sampled risks and the sampled logistic slope.

At \(X=0\), source odds are \(e^\alpha=1/9\). The selection ratio is \(0.4/0.2=2\), so selected-sample odds are \((1/9)2=2/9\). The sampled risk is therefore \((2/9)/(1+2/9)=2/11\).

At \(X=1\), source odds are \(e^{\alpha+\beta}=(1/9)3=1/3\). The selection ratio is \(0.4/0.1=4\), so selected-sample odds are \((1/3)4=4/3\). The sampled risk is \((4/3)/(1+4/3)=4/7\).

The sampled log-odds difference is \(\log(4/3)-\log(2/9)=\log 6\). The source slope was \(\log 3\); the additional \(\log 2\) is the difference between the selection-ratio log values at \(X=1\) and \(X=0\). Subtracting this known selection contribution recovers \(\log 6-\log 2=\log 3\).

Exposure Distributions Among Selected Cases and Controls

The same selection mechanism can be viewed retrospectively, by comparing the covariate distributions of selected cases and selected controls. Let \(f(x\mid Y=y)\) denote the source covariate density (or mass function) within outcome group \(y\). Define \(\kappa_y=E[s_y(X)\mid Y=y]\), the average inclusion probability in that group.

Theorem: If \(0<\kappa_0,\kappa_1<\infty\), then the selected covariate distribution within outcome group \(y\) is $$ f_s(x\mid Y=y)=\frac{s_y(x)f(x\mid Y=y)}{\kappa_y}. $$ Under the source logistic model, the selected case-control density ratio satisfies $$ \frac{f_s(x\mid Y=1)}{f_s(x\mid Y=0)} = C\exp(\beta^\mathsf{T}x)r(x), $$ where \(C=\{P(Y=0)/P(Y=1)\}(\kappa_0/\kappa_1)\) is constant in \(x\). Consequently, if \(\log r(x)=\gamma_0+\gamma^\mathsf{T}x\), this density ratio has covariate slope \(\beta+\gamma\).

Proof. Within outcome group \(y\), selection changes the covariate density in proportion to the inclusion probability. Normalizing gives \(f_s(x\mid Y=y)=s_y(x)f(x\mid Y=y)/\kappa_y\), since integrating the numerator over \(x\) gives \(E[s_y(X)\mid Y=y]=\kappa_y\). Bayes' rule and the source logistic model give $$ \frac{f(x\mid Y=1)}{f(x\mid Y=0)} = \frac{P(Y=0)}{P(Y=1)} \frac{P(Y=1\mid X=x)}{P(Y=0\mid X=x)} = \frac{P(Y=0)}{P(Y=1)}\exp(\alpha+\beta^\mathsf{T}x). $$ Taking the ratio of the two selected densities multiplies this expression by \(s_1(x)/s_0(x)\) and by \(\kappa_0/\kappa_1\). The factors not depending on \(x\), including \(e^\alpha\), combine into \(C\). If \(\log r(x)=\gamma_0+\gamma^\mathsf{T}x\), the covariate-dependent exponent is \((\beta+\gamma)^\mathsf{T}x\), as claimed. \(\square\)

This retrospective calculation explains why distortion also appears as a change in the sampled exposure distribution among controls. The adjustment does not require the control covariate distribution to match its source-population counterpart; it requires the selection ratio to be accounted for. For a design that fixes the numbers of cases and controls, however, the sampled labels are not independent Bernoulli outcomes with the selected probability in the first theorem. Use a likelihood appropriate to that sampling design; the density-ratio identity still describes the selected covariate distributions and their slope relationship.

Worked Example: A Linear Selection Offset

Suppose \(X\) is measured on the interval \([0,1]\). Cases are included with probability \(s_1(x)=0.5\), and controls with probability \(s_0(x)=0.2e^{-0.4x}\). These are valid probabilities: \(s_0(x)\) ranges from \(0.2\) at \(x=0\) to \(0.2e^{-0.4}\approx0.134\) at \(x=1\). Let the source model have \(\alpha=-0.8\) and \(\beta=0.7\).

The selection ratio and its logarithm are \(r(x)=0.5/(0.2e^{-0.4x})=2.5e^{0.4x}\) and \(\log r(x)=\log 2.5+0.4x\). The selected-sample logit is therefore \((-0.8+\log 2.5)+(0.7+0.4)x\). Its intercept is approximately \(0.116\), and its slope is \(1.1\). The slope is not the source slope \(0.7\).

To fit the source parameters using the selected conditional likelihood, put the known term \(\log r(x_i)\) into the model as an offset: \(\operatorname{logit}P(Y_i=1\mid X_i=x_i,S_i=1)=\alpha+\beta x_i+\log r(x_i)\). The fitted coefficient of \(x_i\) in this expression is \(\beta+0.4\); subtracting \(0.4\) recovers the source slope. Equivalently, parameterize the selected model with \(\beta x_i\) and the known offset \(0.4x_i\), so the estimated coefficient directly targets the source slope. The constant \(\log 2.5\) can be absorbed into the intercept, but the covariate-dependent part cannot.

Selection-Adjusted Likelihood and Its Limits

For independent selected observations with covariates treated as given, and a sampling mechanism for which the selected conditional model applies, the likelihood contribution for observation \(i\) is Bernoulli with linear predictor \(\alpha+\beta^\mathsf{T}x_i+\log r(x_i)\). Its log-likelihood is

$$ \ell(\alpha,\beta) = \sum_{i:S_i=1} \left[ y_i\{\alpha+\beta^\mathsf{T}x_i+\log r(x_i)\} - \log\{1+\exp(\alpha+\beta^\mathsf{T}x_i+\log r(x_i))\} \right]. $$

This is a selection-adjusted logistic likelihood: the selection term is known, while \(\alpha\) and \(\beta\) describe the source model. If \(\log r(x)\) is linear, it can be entered as a fixed offset. If it is a known nonlinear function, the function itself can still be used as an offset, preserving the specified source logistic form. With fixed case and control quotas, this displayed likelihood is not automatically the design likelihood; the sampling design must be reflected in the likelihood used for estimation.

Worked Example: Nonlinear Selection by Exposure Level

Let \(X\in\{0,1,2\}\), with source model \(\alpha=-1\) and \(\beta=\log 2\). Suppose cases are included with probability \(0.5\) at every level, while control inclusion probabilities are \(0.2,0.2,0.4\) at levels \(0,1,2\), respectively. Calculate the sampled logits and show why a single linear slope correction is not appropriate.

The source logit at level \(x\) is \(-1+x\log 2\). The selection log-ratio is \(\log(0.5/0.2)=\log 2.5\) at \(x=0,1\), and \(\log(0.5/0.4)=\log 1.25\) at \(x=2\). Adding these terms gives sampled logits \(-1+\log 2.5\approx-0.0837\), \(-1+\log 2+\log 2.5\approx0.6094\), and \(-1+2\log 2+\log 1.25\approx0.6094\).

The consecutive sampled logit differences are approximately \(0.6931\) and \(0\), so the sampled relationship is not linear in \(x\). The source slope is still \(\log 2\), but there is no single slope adjustment that corrects an ordinary linear fit across all three levels. A model with the known level-specific \(\log r(x)\) as an offset subtracts the appropriate selection contribution at each level.

What Can and Cannot Be Recovered

When the selection ratio is known, or its covariate-dependent part is known, the source slope can be recovered under the stated logistic model and a design-appropriate likelihood. Knowing only that controls were selected differently is not enough: if the selection ratio has an unknown covariate trend, that trend is confounded with the source slope. Additional information or assumptions are then needed to distinguish them.

Slope recovery also does not automatically recover population risks. The intercept in the selected outcome model includes the selection-ratio intercept. Under fixed case-control quotas, the sampled case fraction is set by design and does not generally reveal source disease prevalence. Recovering absolute risks or a source-population intercept requires further information, such as sampling fractions or external prevalence information, as appropriate to the design.

Common Mistake

  • Wrong reasoning: “Case-control sampling preserves logistic slopes, so selecting controls differently across exposure levels only changes the intercept.”
  • Correction: Slope preservation requires the case-to-control selection ratio to be constant in the covariates. If \(\log\{s_1(x)/s_0(x)\}\) has a linear covariate trend, that trend is added to the sampled slope. If it varies nonlinearly, the sampled logit may not be linear at all. Use the known selection ratio in the model rather than assuming an intercept-only change.
Key takeaway: Covariate-dependent control selection changes the sampled covariate distribution and can change logistic slopes. The selection ratio \(s_1(x)/s_0(x)\) determines the distortion; incorporating its known log into the likelihood is the direct route to recovering source-population slopes.

Check Your Understanding

Use the selection ratio, rather than the control inclusion probabilities in isolation, to reason through these questions.

  1. If \(s_1(x)/s_0(x)\) is constant in \(x\), what happens to the selected logistic slope, and why?
  2. If \(\log\{s_1(x)/s_0(x)\}=\gamma_0+\gamma^\mathsf{T}x\), what is the relationship between the selected-sample slope and the source slope?
  3. Why can unequal control inclusion across covariate values alter the selected exposure distribution among controls?
  4. What selection information is needed to use the known-ratio likelihood adjustment to recover the source slope?
  5. Why is a fixed-quota case-control design not automatically represented by an independent Bernoulli likelihood for the selected outcomes?
Clinical Biostats