Introduction
Logistic regression is one of the most important regression methods used in clinical research when the primary outcome is binary.
Examples include:
- Responder vs. non-responder
- Remission vs. no remission
- Event vs. no event
- Adverse event vs. no adverse event
- Disease progression vs. no progression
- Successful treatment vs. unsuccessful treatment
In Part 1, the central idea is that logistic regression models the probability of a binary outcome through the logit transformation. Part 2 takes the next step and works through a complete clinical example.
The Clinical Question
Suppose a randomized clinical trial compares a new treatment with control. The primary binary endpoint is whether a patient achieves a predefined clinical response at Week 12.
The investigators want to answer two questions:
- Does treatment increase the probability of response?
- Does the treatment effect remain after adjusting for important baseline covariates?
The second question motivates the multivariable logistic regression model.
Defining the Outcome
Let:
The probability of response for patient \(i\) is:
Because \(p_i\) must lie between 0 and 1, directly modeling the probability with ordinary linear regression can produce impossible predicted values.
Logistic regression instead models the log odds:
The Multivariable Clinical Model
Suppose the model includes:
- \(X_1\) = treatment indicator
- \(X_2\) = baseline age
- \(X_3\) = baseline disease severity score
Let treatment be coded:
| Variable | Value | Meaning |
|---|---|---|
treatment = 0 |
0 | Control |
treatment = 1 |
1 | Experimental treatment |
The logistic regression model is:
Equivalently:
A Synthetic Clinical Dataset
For this worked example, consider a synthetic Phase III dataset containing 300 patients, with 150 patients assigned to each treatment group.
The binary endpoint is response at Week 12.
| Variable | Description |
|---|---|
| Response | 1 = responder; 0 = non-responder |
| Treatment | 1 = experimental; 0 = control |
| Age | Baseline age in years |
| Severity | Baseline disease severity score |
The observed response rates are:
| Treatment Group | Patients | Responders | Observed Response Rate |
|---|---|---|---|
| Control | 150 | 30 | 20.0% |
| Experimental | 150 | 86 | 57.3% |
The crude treatment comparison already suggests a substantial treatment effect. However, the clinical analysis may also need to account for baseline covariates.
Crude Odds Ratio Before Adjustment
Before fitting the multivariable model, calculate the unadjusted odds ratio.
For the control group:
For the experimental treatment:
Therefore, the crude odds ratio is:
Thus, the unadjusted odds of response are approximately 5.38 times higher in the experimental group than in the control group.
Fitting the Logistic Regression Model
Suppose the fitted model produces the following coefficient estimates:
| Parameter | Estimate | Standard Error | P-value |
|---|---|---|---|
| Intercept | 2.929 | 0.994 | 0.003 |
| Treatment | 1.804 | 0.280 | <0.001 |
| Age | -0.038 | 0.014 | 0.008 |
| Severity | -0.772 | 0.198 | <0.001 |
The fitted equation is therefore approximately:
Interpreting the Treatment Coefficient
The treatment coefficient is:
This is a change in log odds, not a change in probability.
To obtain the odds ratio, exponentiate the coefficient:
Therefore, after adjusting for age and baseline severity, the estimated odds of response are approximately 6.07 times higher for the experimental treatment than for control.
Why "6 Times More Likely" Is Incorrect
A common reporting error is to say:
"Patients were six times more likely to respond."
That wording is generally incorrect because the logistic regression coefficient produces an odds ratio, not a risk ratio or probability ratio.
The correct statement is:
The distinction matters especially when the outcome is common. Odds and probabilities can differ substantially when event rates are not small.
Converting the Treatment Effect to a Confidence Interval
Suppose the 95% confidence interval for the treatment coefficient on the log-odds scale is approximately:
This gives approximately:
Exponentiating both limits gives the confidence interval for the odds ratio:
Thus the adjusted treatment effect can be reported as approximately:
Because the confidence interval excludes 1, the treatment effect is statistically significant at the conventional two-sided 5% level.
Interpreting the Age Coefficient
The age coefficient is:
The corresponding odds ratio is:
Therefore, for a one-year increase in age, the estimated odds of response are multiplied by approximately 0.963, holding treatment and severity constant.
Equivalently, the odds decrease by approximately:
per additional year of age.
Interpreting Age Per 10 Years
Because the age coefficient represents one year, the odds ratio for a 10-year increase is:
Thus, holding treatment and severity constant, a 10-year increase in age is associated with approximately 31.6% lower odds of response.
Interpreting Baseline Severity
The severity coefficient is:
Its odds ratio is:
Thus, for a one-unit increase in baseline severity, the odds of response are multiplied by approximately 0.462, holding treatment and age constant.
This corresponds to approximately a:
decrease in the odds of response per one-unit increase in severity.
The Full Odds-Ratio Table
A typical clinical regression table might therefore look like this:
| Predictor | Adjusted OR | 95% CI | P-value |
|---|---|---|---|
| Experimental vs. control | 6.07 | 3.51–10.52 | <0.001 |
| Age, per year | 0.963 | approximately 0.936–0.990 | 0.008 |
| Severity, per unit | 0.462 | approximately 0.313–0.683 | <0.001 |
For a clinical report, the treatment effect would usually be the primary parameter of interest, while the baseline covariates provide adjustment and additional clinical context.
From Odds Ratios to Predicted Probabilities
Odds ratios are useful, but clinicians often find probabilities easier to interpret.
The inverse-logit transformation converts a linear predictor back to a probability:
where:
Predicted Probability for a Control Patient
Consider a hypothetical control patient with:
- Age = 55 years
- Severity = 3.0
- Treatment = 0
The linear predictor is:
Therefore:
The predicted probability is:
So the predicted probability of response for this representative control patient is approximately 18.6%.
Predicted Probability for an Experimental Patient
Now change only treatment from control to experimental.
The linear predictor becomes:
Thus:
The predicted probability is:
The representative experimental patient therefore has an estimated probability of response of approximately 58.1%.
| Representative Patient | Treatment | Predicted Probability |
|---|---|---|
| Age 55, severity 3.0 | Control | 18.6% |
| Age 55, severity 3.0 | Experimental | 58.1% |
Adjusted vs. Unadjusted Treatment Effects
The crude odds ratio was approximately:
The adjusted odds ratio from the multivariable model is approximately:
These estimates are not identical.
The crude estimate compares treatment groups without accounting for age or severity. The adjusted estimate compares treatment groups after accounting for the covariates in the specified model.
| Analysis | Treatment OR | Interpretation |
|---|---|---|
| Unadjusted | 5.38 | Crude treatment association |
| Adjusted | 6.07 | Treatment association conditional on age and severity |
R Implementation
A logistic regression can be fit in R using glm()
with the binomial family.
model <- glm( response ~ treatment + age + severity, data = clinical_data, family = binomial(link = "logit") ) summary(model)
The coefficient estimates are on the log-odds scale.
To obtain odds ratios:
exp(coef(model))
To obtain 95% Wald confidence intervals for the odds ratios:
results <- cbind( OR = exp(coef(model)), exp(confint.default(model)) ) results
Obtaining Predicted Probabilities in R
Predicted probabilities can be generated using
type = "response".
new_patient_control <- data.frame( treatment = 0, age = 55, severity = 3.0 ) new_patient_treatment <- data.frame( treatment = 1, age = 55, severity = 3.0 ) predict( model, newdata = new_patient_control, type = "response" ) predict( model, newdata = new_patient_treatment, type = "response" )
This produces probabilities on the original 0-to-1 scale rather than on the log-odds scale.
SAS Implementation
In SAS, the corresponding analysis can be performed with
PROC LOGISTIC.
proc logistic data=clinical_data;
class treatment(ref='0') / param=ref;
model response(event='1') =
treatment
age
severity;
oddsratio treatment;
oddsratio age;
oddsratio severity;
run;
The event='1' option makes the modeled event
explicit: the probability of being a responder.
Why the EVENT Definition Matters
Suppose response is coded:
- 1 = responder
- 0 = non-responder
Then the model should estimate:
If the event is accidentally defined as the non-response category, the model will estimate:
The resulting odds ratios will be interpreted in the opposite direction.
Checking the Model
Fitting the model is not the end of the analysis.
Important questions include:
- Are the covariates clinically appropriate?
- Are continuous covariates modeled appropriately?
- Are there sparse cells or separation?
- Are influential observations present?
- Is the model excessively complex for the available number of events?
- Does the model discriminate between responders and non-responders?
- Is calibration adequate?
Linearity on the Logit Scale
A particularly important assumption concerns continuous predictors.
For example, the model above assumes that:
This means the relationship between age and the log odds is linear.
It does not mean that the probability itself changes linearly with age.
Interactions
A basic logistic model assumes that the treatment effect is the same across the levels of the included covariates unless interaction terms are included.
For example, a treatment-by-age interaction could be written as:
In that model, the treatment effect depends on age.
The treatment odds ratio at a particular age is no longer simply \(e^{\beta_1}\).
Instead, it depends on the interaction term.
Odds Ratio vs. Risk Ratio
One of the most important distinctions in clinical interpretation is the difference between odds and risk.
Suppose two groups have response probabilities:
The risk ratio is:
But the odds ratio is:
Thus an odds ratio of 3.5 does not mean the probability is 3.5 times as high.
| Measure | Definition |
|---|---|
| Risk | \(p\) |
| Odds | \(p/(1-p)\) |
| Risk ratio | \(p_T/p_C\) |
| Odds ratio | \(\text{Odds}_T/\text{Odds}_C\) |
Model Discrimination
A logistic model can also be evaluated for its ability to distinguish patients with and without the event.
A common measure is the area under the receiver operating characteristic curve, or AUC.
An AUC near 0.5 indicates little discrimination, while larger values indicate better discrimination.
However, a strong AUC does not prove that the model is well calibrated.
Model Calibration
Calibration asks whether predicted probabilities agree with observed outcome frequencies.
For example, among patients predicted to have approximately 70% probability of response, we would ideally observe a response rate close to 70%.
Separation and Sparse Data
Logistic regression can become unstable when a predictor or combination of predictors almost perfectly separates responders from non-responders.
For example, suppose every patient with a particular rare baseline characteristic responds and every patient without it fails.
Maximum likelihood estimates may become extremely large or fail to converge.
This problem is called separation.
Potential approaches include:
- Reviewing the clinical data for sparse cells
- Reducing unnecessary model complexity
- Combining clinically appropriate sparse categories
- Using penalized or exact methods when justified
- Prespecifying appropriate handling in the statistical analysis plan
Clinical Interpretation of the Worked Example
The main result from our example is:
The interpretation is:
The model also suggests that increasing age and greater baseline severity are associated with lower odds of response, although the scientific importance of these associations should be considered separately from the primary treatment comparison.
How to Report the Result
A concise clinical-trial report might state:
This wording identifies:
- The endpoint
- The statistical method
- The adjustment variables
- The treatment comparison
- The adjusted odds ratio
- The confidence interval
- The P-value
What Not to Report
Avoid statements such as:
- "Treatment increased response by 607%."
- "Patients were 6.07 times more likely to respond."
- "The probability of response was 6.07 times higher."
- "The treatment caused a six-fold increase in response probability."
These statements confuse odds ratios with probability or risk ratios.
A Practical Analysis Workflow
Common Mistakes
- Calling an odds ratio a risk ratio. An odds ratio and a risk ratio are different measures.
- Interpreting \(e^\beta\) as a probability change. Exponentiating a logistic coefficient produces an odds ratio.
- Ignoring the reference category. Every categorical treatment or covariate effect is interpreted relative to its specified reference level.
- Failing to specify the modeled event. Reversing the event definition reverses the direction of interpretation.
- Adding many covariates without justification. An unnecessarily complex model can become unstable, especially with limited numbers of events.
- Assuming continuous predictors are automatically linear. Logistic regression assumes linearity on the logit scale for ordinary continuous predictor terms.
- Reporting only the P-value. The estimated effect and confidence interval are essential for understanding magnitude and precision.
- Confusing adjusted and unadjusted estimates. The crude treatment comparison and the multivariable treatment effect answer different questions.
- Assuming statistical significance implies clinical importance. A small P-value does not by itself establish that an effect is clinically meaningful.
- Ignoring model diagnostics. Convergence, separation, influential observations, discrimination, and calibration should be considered.
When Logistic Regression Is Especially Useful
Logistic regression is particularly useful when:
- The primary endpoint is binary.
- Adjustment for baseline prognostic factors is desired.
- The treatment effect needs to be expressed as an odds ratio.
- Multiple predictors are clinically relevant.
- Predicted probabilities are useful for interpretation or prediction.
- Effect modification or interactions are scientifically important.
When Logistic Regression May Not Be the Best Choice
Logistic regression is not automatically the best model for every clinical endpoint.
| Endpoint | Potentially Appropriate Method |
|---|---|
| Continuous outcome | Linear regression / ANCOVA |
| Time-to-event outcome | Cox proportional hazards or another survival model |
| Repeated binary outcomes | GEE or mixed-effects logistic regression |
| Ordinal outcome | Ordinal logistic regression or related model |
| Count outcome | Poisson or negative binomial regression |
The model should be selected based on the structure of the endpoint and the scientific question, not simply because logistic regression is familiar.
One More Important Distinction: Association vs. Prediction
The worked example is primarily an inferential clinical model. The principal question is whether treatment is associated with response after adjustment for prespecified covariates.
A predictive model has a different goal: accurately predicting outcomes for future patients.
Predictive modeling may require additional considerations such as:
- Internal validation
- Bootstrap validation
- Cross-validation
- Calibration assessment
- Optimism correction
- External validation
- Prediction intervals or uncertainty assessment
The Complete Worked Example in One View
| Component | Result |
|---|---|
| Endpoint | Week 12 binary response |
| Total sample size | 300 |
| Control patients | 150 |
| Experimental patients | 150 |
| Control response rate | 20.0% |
| Experimental response rate | 57.3% |
| Crude treatment OR | 5.38 |
| Adjusted treatment coefficient | 1.804 |
| Adjusted treatment OR | 6.07 |
| 95% CI for treatment OR | 3.51–10.52 |
| Treatment P-value | <0.001 |
| Age OR per year | 0.963 |
| Severity OR per unit | 0.462 |
| Predicted response, representative control patient | 18.6% |
| Predicted response, representative treatment patient | 58.1% |
The Most Important Concept
The most important lesson from a clinical logistic regression analysis is that the model connects three different scales:
The model is fit on the log-odds scale, coefficients are exponentiated to produce odds ratios, and the inverse-logit transformation converts the fitted model back into predicted probabilities.
References
Hosmer, D.W., Lemeshow, S. & Sturdivant, R.X. (2013).
Applied Logistic Regression.
3rd ed. Wiley.
Agresti, A. (2018).
An Introduction to Categorical Data Analysis.
3rd ed. Wiley.
Harrell, F.E. (2015).
Regression Modeling Strategies.
2nd ed. Springer.
Vittinghoff, E., Glidden, D.V., Shiboski, S.C. & McCulloch, C.E. (2012).
Regression Methods in Biostatistics.
2nd ed. Springer.
SAS Institute Inc.
PROC LOGISTIC Documentation.
R Core Team.
R: A Language and Environment for Statistical Computing.
See logistic regression in real clinical trials
See the method applied to published trial results, with the estimates, confidence intervals and interpretation explained.