Why Model a Binary Exposure-Response?
A pharmacodynamic endpoint may be whether a participant experiences a response by a specified assessment time: for example, whether a symptom improves or a laboratory threshold is crossed. The result is binary, but the probability of that result can vary with drug exposure. Logistic regression gives a model for that probability while ensuring its predictions remain between zero and one.
The analysis depends on defining the endpoint and exposure precisely. In the hypothetical analysis below, \(Y=1\) means that a prespecified response occurred during a fixed assessment window, and \(Y=0\) means it did not. \(C\) is concentration in mg/L measured at a prespecified time. The analysis describes an exposure-response association; by itself, it does not establish that concentration caused the response.
Model, Likelihood, and Assumptions
For interpretation, define \(z=(C-2)/2\), with \(C\) in mg/L. Thus \(z=0\) at 2 mg/L, and a one-unit increase in \(z\) is a 2 mg/L increase in concentration. The model is
For independent participants \(i=1,\ldots,n\), the model assumes \(Y_i\mid C_i\) is Bernoulli with probability \(p_i\). The likelihood and log-likelihood are
Maximum likelihood chooses the coefficients that maximize this log-likelihood. The main assumptions are that each outcome is coded consistently, observations are independent conditional on modeled predictors, and the log odds change linearly with \(z\). The exposure measurement and assessment window must also represent the scientific question. If participants contribute repeated outcomes, treating those outcomes as independent generally understates uncertainty; a model accounting for within-participant dependence is needed.
The linearity assumption concerns log odds, not probability. Consequently, a straight line in concentration need not describe probability changes equally well across the exposure range. Plots of observed response proportions across exposure, together with residual and predictive checks, can reveal departures; a nonlinear exposure term may be needed when the linear-logit assumption is not credible.
Worked Example: Fitting a Logistic Model to Grouped Outcomes
Suppose 60 hypothetical participants have the following outcomes. Each participant is assessed once, and the three concentration groups are 0, 2, and 4 mg/L. The entries are counts of responses among 20 participants in each group.
| Concentration \(C\) (mg/L) | \(z=(C-2)/2\) | Responses | No response |
|---|---|---|---|
| 0 | -1 | 4 | 16 |
| 2 | 0 | 10 | 10 |
| 4 | 1 | 16 | 4 |
The observed response proportions are \(4/20=0.20\), \(10/20=0.50\), and \(16/20=0.80\). Their observed logits are \(\log(0.20/0.80)=\log(0.25)\), \(0\), and \(\log(0.80/0.20)=\log(4)\). These values lie exactly on a line in \(z\): the intercept is 0 and the slope is \(\log(4)\approx1.386\). Therefore the model predictions are \(p(-1)=0.20\), \(p(0)=0.50\), and \(p(1)=0.80\).
This is also the maximum-likelihood fit, not merely a line drawn through proportions. For grouped binomial observations, the score for coefficient \(j\) is \(\sum_g z_g^j(y_g-n_gp_g)\), where \(z_g^0=1\), \(y_g\) is the response count, and \(n_g\) is the group size. At the stated predictions, each residual \(y_g-n_gp_g\) is zero: \(4-20(0.20)=0\), \(10-20(0.50)=0\), and \(16-20(0.80)=0\). Both score components are thus zero. The log-likelihood is concave, and the design contains distinct \(z\) values with both outcome classes represented, so this finite stationary fit is the maximum.
The estimated odds multiply by \(\exp(1.386)=4.00\) for each 2 mg/L increase. That is an odds ratio, not a fourfold increase in probability. The observed and fitted probabilities increase from 0.20 to 0.80 across the displayed range.
Interpreting Effects as Odds and Probabilities
In this model, \(\beta_1\) is the change in log odds per 2 mg/L increase. Exponentiating gives the corresponding odds ratio, \(\exp(\beta_1)\). For a change of \(d\) units in \(z\), the odds ratio is \(\exp(d\beta_1)\). A probability contrast must instead be calculated from the logistic function at both exposure values: subtracting probabilities is not the same operation as exponentiating a coefficient.
Worked Example: Comparing Predicted Response Probabilities
Using the fitted model from the hypothetical grouped data, compare response at 0 and 4 mg/L. At 0 mg/L, \(z=-1\), so the linear predictor is \(0+1.386(-1)=-1.386\). The predicted probability is
At 4 mg/L, \(z=1\), so the linear predictor is \(1.386\), and
The estimated probability difference is \(0.800-0.200=0.600\), or 60 percentage points, over a 4 mg/L concentration difference. The odds are \(0.20/0.80=0.25\) at 0 mg/L and \(0.80/0.20=4\) at 4 mg/L, so the high-versus-low odds ratio is \(4/0.25=16\). This also equals \(\exp\{2(1.386)\}=16\), because the exposure contrast is two units of \(z\). State the exposure values and units with a probability contrast: here it compares 0 with 4 mg/L under the fitted model.
Uncertainty should accompany reported effects. For this illustrative fit, the observed information matrix for \((\beta_0,\beta_1)\) is diagonal because the concentration groups are symmetric around \(z=0\). Its diagonal entries are \(\sum n_gp_g(1-p_g)=11.4\) for the intercept and \(\sum n_gp_g(1-p_g)z_g^2=6.4\) for the slope. The usual model-based standard error for the slope is therefore \(\sqrt{1/6.4}=0.3953\). A Wald 95% interval is \(1.386\pm1.96(0.3953)=(0.611,2.161)\); exponentiating gives an interval of approximately 1.84 to 8.68 for the odds ratio per 2 mg/L. Under the model and its large-sample approximation, this interval procedure has 95% coverage in repeated samples. It does not assign a 95% probability to the fixed coefficient being inside this particular interval.
A probability contrast has its own uncertainty and should not inherit the coefficient interval by simply relabeling its endpoints. For this symmetric example, the estimated contrast between \(z=1\) and \(z=-1\) is \(D=p(1)-p(-1)\). Its gradient with respect to \((\beta_0,\beta_1)\) is \((0,0.32)\): the intercept derivatives cancel, while the slope derivative is \(0.8(0.2)(1)-0.2(0.8)(-1)=0.32\). Using the model-based covariance matrix, \(SE(D)=0.32\sqrt{1/6.4}=0.1265\). A Wald interval is \(0.600\pm1.96(0.1265)=(0.352,0.848)\). This approximation is useful for illustration; with sparse data or probabilities near 0 or 1, likelihood-based or bootstrap uncertainty methods may behave better.
Calibration, Separation, and Other Checks
Calibration asks whether predicted probabilities agree with observed response frequencies. It is different from discrimination, which concerns how well predictions rank participants who respond above those who do not. For an independent validation sample, a calibration model can regress outcomes on the logit of the original predictions: an ideal calibration intercept is 0 and slope is 1. A calibration plot compares observed frequencies with predicted probabilities across suitable groups or smooth ranges. With small samples, such summaries are imprecise; a nonsignificant goodness-of-fit test does not establish good calibration.
In the first worked example, each group's fitted proportion exactly equals its observed proportion, so the grouped data show exact in-sample agreement. This is not strong evidence of reliable calibration in new participants: the same observations were used to fit and assess the model, and only three exposure levels were represented. Internal resampling or an independent validation sample can better assess predictive performance. Also inspect the exposure range, influential observations, outcome counts, and whether a nonlinear concentration effect is plausible.
Separation is a distinct fitting failure. Complete separation occurs when a predictor or combination of predictors perfectly divides the outcome classes. In that case, increasing a coefficient in the separating direction can keep improving the likelihood as its magnitude grows, so no finite maximum-likelihood estimate exists. Near separation can also produce very large estimates and standard errors. Warning signs include convergence problems, extreme coefficients, enormous standard errors, and fitted probabilities effectively equal to 0 or 1.
Worked Example: Recognizing Complete Separation
Consider a different hypothetical sample with 20 participants at 0 mg/L and 20 at 4 mg/L. Suppose there are 0 responses at 0 mg/L and 20 responses at 4 mg/L. Every nonresponse has \(z=-1\), and every response has \(z=1\); concentration perfectly separates the outcomes.
For the lower group, the likelihood contribution is \((1-p(-1))^{20}\); for the upper group it is \(p(1)^{20}\). Let the intercept be 0 and let the slope \(b\) increase. Then \(p(-1)=1/(1+\exp(b))\) tends to 0 and \(p(1)=1/(1+\exp(-b))\) tends to 1 as \(b\) tends to infinity. The likelihood approaches 1, its largest possible value, but no finite \(b\) attains it. Thus ordinary maximum likelihood has no finite slope estimate here. Reporting a huge fitted odds ratio as if it were a stable estimate would be misleading.
A suitable response is to report the separation and avoid interpreting an unstable ordinary estimate as precise evidence. Depending on the analysis goal, options include collecting more informative data, using a prespecified penalized logistic method such as Firth’s correction, or using a Bayesian model with defensible prior information. These approaches change the estimation procedure; they do not make the sparse data intrinsically informative.
Model Choices, Limitations, and Reporting
A linear concentration term is compact and interpretable when log odds plausibly change approximately linearly over the observed range. A categorical concentration model is more flexible at the measured levels, but uses more parameters and does not directly describe interpolation between levels. Nonlinear terms can represent curvature while retaining concentration as quantitative, but require enough data to estimate their added flexibility. The choice should reflect the scientific question and available information, not merely which model gives the smallest in-sample deviance.
Ordinary logistic regression also has limitations: sparse response counts can cause separation or unstable uncertainty; omitted predictors can distort an adjusted association; and a single linear predictor may not represent important heterogeneity or repeated measurements. A fitted exposure association should not be described as a causal drug effect without an appropriate design and assumptions supporting causal interpretation. Predictions beyond the observed concentration range are extrapolations and can be especially unreliable.
A clear report specifies the binary endpoint and assessment window, concentration units and transformation, number of participants and events, model form, coefficient or odds ratio with uncertainty, and predicted probabilities or contrasts at clinically relevant exposures. Identify whether contrasts are adjusted for other covariates, and describe calibration and any separation or convergence problems. These details let readers distinguish a change in odds from a change in response probability.
Check Your Understanding
Answer each question, then compare with the concise solutions below.
- In the model \( \operatorname{logit}\{p(C)\}=\beta_0+\beta_1(C-2)/2 \), what exposure increase corresponds to a one-unit increase in the predictor?
- If \(\beta_1=\log(3)\), what is the odds ratio for a 4 mg/L increase in concentration?
- For the fitted model in the first example, calculate the predicted response probability at 2 mg/L and the probability difference between 2 and 4 mg/L.
- Why does exact agreement between observed and fitted group proportions in the first example not prove good calibration in new participants?
- What is the maximum-likelihood problem when all low-concentration participants have no response and all high-concentration participants respond?
Solutions. (1) One unit is a 2 mg/L increase. (2) The increase is two predictor units, so the odds ratio is \(\exp\{2\log(3)\}=9\). (3) At 2 mg/L, \(z=0\), so \(p=1/(1+\exp(0))=0.500\); at 4 mg/L, \(p=0.800\), giving a difference of \(0.800-0.500=0.300\), or 30 percentage points. (4) The same small data set estimated and assessed the model, with only three exposure levels; validation on new or resampled data is needed to assess predictive calibration. (5) Complete separation makes the likelihood increase toward its supremum as the slope grows, without attaining a finite maximum-likelihood estimate.