Tutorials › Generalized Linear Models › Correcting Logistic Intercepts With Known Sampling Fractions

Case-Control and Sampling Designs · Tutorial 966 of 981

Correcting Logistic Intercepts With Known Sampling Fractions

Use known outcome-specific sampling fractions to correct a case-control logistic intercept and recover source-population risks.

Advanced 12 min read

What You'll Learn

  • Define outcome-specific sampling fractions and the selected-sample probability.
  • Derive the intercept shift induced by case-control sampling.
  • Correct a fitted logistic intercept using the known sampling-fraction ratio.
  • Compute source-population risks and compare them with selected-sample probabilities.
  • Identify the conditions under which the correction is valid.
  • Avoid confusing an odds adjustment with a direct probability adjustment.

Why the Intercept Needs Correction

Case-control sampling deliberately selects people according to their outcome: cases and controls are recruited in proportions set by the study design, not by their proportions in the source population. A logistic regression fitted to such a sample can describe how the odds vary with covariates, but its fitted probabilities generally describe the selected sample rather than the source population. When the outcome-specific sampling fractions are known, the intercept can be adjusted to recover source-population risks.

The key is that selection changes the odds of the outcome by a known multiplicative factor. On the log-odds scale, that factor becomes an additive shift in the intercept. The adjustment is exact under the conditions below; it is not a rare-disease approximation.

Sampling Fractions and the Intercept Shift

Definition: Let \(Y\in\{0,1\}\) be the outcome, \(X=x\) a covariate value, and \(S=1\) indicate inclusion in the case-control sample. The outcome-specific sampling fractions are \(s_1=P(S=1\mid Y=1)\) and \(s_0=P(S=1\mid Y=0)\). Write \(p(x)=P(Y=1\mid X=x)\) for the source-population risk and \(q(x)=P(Y=1\mid X=x,S=1)\) for the selected-sample probability.

Assume both fractions are positive and do not depend on \(X\): \(P(S=1\mid Y=y,X=x)=s_y\) for \(y=0,1\). Also assume the source-population model is logistic:

$$ \operatorname{logit} p(x) =\log\!\left(\frac{p(x)}{1-p(x)}\right) =\alpha+\beta^{\mathsf T}x. $$

The notation \(\alpha\) and \(\beta\) refers to the source-population intercept and slope vector. The selected-sample model has its own intercept, which will be shifted by the sampling design.

Theorem: Under the conditions above, the selected-sample outcome probability satisfies \(\operatorname{logit}q(x)=\alpha+\log(s_1/s_0)+\beta^{\mathsf T}x\). Thus the slopes are unchanged, while the selected-sample intercept equals \(\alpha+\log(s_1/s_0)\).

Proof. Conditional on \(X=x\), selection gives \(P(Y=1,S=1\mid X=x)=s_1p(x)\) and \(P(Y=0,S=1\mid X=x)=s_0\{1-p(x)\}\). Both quantities are positive under the stated conditions, so the selected-sample odds are

$$ \frac{q(x)}{1-q(x)} = \frac{P(Y=1,S=1\mid X=x)}{P(Y=0,S=1\mid X=x)} = \frac{s_1p(x)}{s_0\{1-p(x)\}} = \frac{s_1}{s_0}\frac{p(x)}{1-p(x)}. $$

Taking logarithms and substituting the source logistic model yields \(\operatorname{logit}q(x)=\log(s_1/s_0)+\alpha+\beta^{\mathsf T}x\), as claimed. \(\square\)

Let \(\gamma\) denote the selected-sample intercept. Since \(\gamma=\alpha+\log(s_1/s_0)\), recovering the source intercept requires subtracting the log ratio:

$$ \alpha=\gamma-\log\!\left(\frac{s_1}{s_0}\right). $$

If a fitted case-control logistic model has estimated intercept \(\hat{\gamma}\) and slopes \(\hat{\beta}\), and the sampling fractions are treated as known, the corrected estimated source risk is

$$ \hat{p}(x) = \frac{1}{1+\exp\!\left[-\left\{\hat{\gamma}-\log(s_1/s_0)+\hat{\beta}^{\mathsf T}x\right\}\right]}. $$

This is a plug-in estimate: the known design adjustment changes the intercept, while the fitted slopes are retained. It does not make the sample probabilities themselves equal to source risks.

Two Equivalent Ways to Correct a Risk

The intercept formula gives the correction directly on the linear-predictor scale. A second form makes the odds adjustment explicit and is useful when a selected-sample probability has already been calculated.

Result: For \(0<q(x)<1\), the source-population risk is \[ p(x)=\frac{q(x)s_0}{s_1\{1-q(x)\}+s_0q(x)} =\frac{q(x)}{(s_1/s_0)\{1-q(x)\}+q(x)}. \] Equivalently, the source odds equal the selected-sample odds multiplied by \(s_0/s_1\).

Derivation. Start from the odds identity established above: \(\{q(x)/(1-q(x))\}=(s_1/s_0)\{p(x)/(1-p(x))\}\). Solving for \(p(x)\) gives

$$ q(x)s_0\{1-p(x)\}=s_1p(x)\{1-q(x)\}, $$

so \(q(x)s_0=p(x)[s_1\{1-q(x)\}+s_0q(x)]\). Dividing by the positive bracket gives the stated formula. This derivation also shows why the correction acts on odds, not directly on probabilities.

Worked Example: Correcting Risks When Cases Are Oversampled

Suppose the case sampling fraction is \(s_1=0.20\), the control sampling fraction is \(s_0=0.10\), and a fitted sample model is \(\operatorname{logit}q(x)=-3+\log(2)+(\log 2)x\), where \(x\) is binary. The sampling-fraction ratio is \(s_1/s_0=2\), so the corrected source intercept is \[ \hat{\alpha}=(-3+\log 2)-\log 2=-3. \] The source model is therefore \(\operatorname{logit}p(x)=-3+(\log 2)x\).

At \(x=0\), the source odds are \(e^{-3}\approx0.049787\), and the source risk is \[ p(0)=\frac{e^{-3}}{1+e^{-3}}=\frac{1}{1+e^3}\approx0.04743. \] The selected odds are twice the source odds, \(2e^{-3}\approx0.09957\), giving \[ q(0)=\frac{2e^{-3}}{1+2e^{-3}} =\frac{2}{e^3+2}\approx0.09056. \] Thus the sample probability is about 9.06%, while the source risk is about 4.74%.

At \(x=1\), the source linear predictor is \(-3+\log 2\), so its odds are \(2e^{-3}\approx0.09957\), and \[ p(1)=\frac{2e^{-3}}{1+2e^{-3}}\approx0.09056. \] The selected odds are \(2(2e^{-3})=4e^{-3}\approx0.19915\), and hence \[ q(1)=\frac{4e^{-3}}{1+4e^{-3}} =\frac{4}{e^3+4}\approx0.16608. \] The corrected source risks are lower at both covariate values because cases were sampled at twice the rate of controls.

Worked Examples With Different Sampling Ratios

Worked Example: Controls Are Sampled More Heavily

Suppose \(s_1=0.12\), \(s_0=0.30\), and the fitted selected-sample model has intercept \(\hat{\gamma}=-1.2\). At \(x=0\), the fitted sample probability is \[ q(0)=\frac{1}{1+e^{1.2}}\approx0.2315. \] Here \(s_1/s_0=0.4\), so the corrected source intercept is \[ \hat{\alpha}=-1.2-\log(0.4)=-1.2+0.91629\approx-0.28371. \] The source risk is therefore \[ \hat{p}(0)=\frac{1}{1+e^{0.28371}}\approx0.4295. \]

The odds check gives the same answer. The sample odds are \(e^{-1.2}\approx0.30119\); dividing by \(0.4\) gives source odds \(0.75299\). Converting those odds to a probability gives \(0.75299/(1+0.75299)\approx0.4295\). The source risk exceeds the sample probability because controls were selected at a higher rate than cases.

Worked Example: Correcting a Risk at a Nonzero Covariate Value

Suppose the fitted selected-sample model is \(\operatorname{logit}q(x)=-2+0.5x\), with \(s_1=0.50\) and \(s_0=0.05\). Then \(s_1/s_0=10\) and the source intercept is \[ \hat{\alpha}=-2-\log(10)\approx-4.302585. \] At \(x=2\), the selected linear predictor is \(-2+0.5(2)=-1\), so \[ q(2)=\frac{1}{1+e}\approx0.26894. \] The corrected source linear predictor is \(-4.302585+0.5(2)=-3.302585\). Its odds are \(e^{-3.302585}=e^{-1}/10\approx0.036788\), and the source risk is \[ p(2)=\frac{0.036788}{1+0.036788}\approx0.03548. \] As a check, the sample odds at \(x=2\) are \(e^{-1}\approx0.367879\); dividing by the sampling ratio 10 gives the source odds \(0.036788\). The selected probability of about 26.89% is therefore not the source risk, which is about 3.55%.

Conditions, Interpretation, and Common Pitfall

The correction depends on the sampling design having the stated form. In particular, within each outcome group, the chance of selection must be constant across covariate values. If \(P(S=1\mid Y=y,X=x)\) varies with \(x\), the selection effect need not be a single intercept shift. The source model must also be appropriately represented by the logistic model, and the sampling fractions must refer to selection from the target source population. Positivity, \(s_1>0\) and \(s_0>0\), is needed for the log ratio and for both outcome groups to be represented.

A frequent mistake is to subtract \(s_1/s_0\) from the fitted intercept, or to multiply a fitted probability by \(s_0/s_1\). Neither operation is correct. The intercept adjustment is \(-\log(s_1/s_0)\), because the sampling ratio multiplies the odds. For example, when cases are sampled twice as often as controls, the selected odds are twice the source odds; the source odds are obtained by dividing the selected odds by two, not by subtracting two from the intercept or halving the probability.

Correcting the intercept matters whenever fitted probabilities are to be interpreted as source-population risks. The selected-sample model answers a valid but different question: the probability of being a case among sampled people at a given covariate value. Using its probabilities as population risks can substantially overstate or understate absolute risk, even though the odds-ratio slopes are preserved under this sampling scheme.

Key takeaway: With known, positive outcome-specific sampling fractions that do not vary with covariates, subtract \(\log(s_1/s_0)\) from the fitted case-control intercept. This recovers the source-population logistic intercept; calculate source risks from that corrected linear predictor.

Check Your Understanding

Use the sampling-ratio rule and show the relevant odds or linear-predictor calculation.

  1. If \(s_1=0.15\) and \(s_0=0.05\), what quantity must be subtracted from the fitted sample intercept to recover the source intercept?
  2. Why does outcome-dependent sampling with fractions constant over \(X\) preserve logistic slopes?
  3. A selected-sample probability is \(q=0.40\), with \(s_1/s_0=4\). Find the corresponding source risk using the odds adjustment.
  4. What design feature could make a single intercept correction invalid, even if the overall case and control sampling fractions are known?
  5. Explain why multiplying a selected-sample probability by \(s_0/s_1\) is not the correct general probability correction.
Clinical Biostats