Statistical Methods
Interpret Logistic Interactions Through Predicted Probabilities
Specify the scale of the question
An interaction describes how a contrast depends on another variable, but the conclusion depends on the scale used. A product term in a logistic model concerns the log-odds scale. It is not automatically the same quantity as a difference between two risk differences.
Write the outcome coded as one, the binary exposure A, and the binary modifier M. For the simple model considered here, the linear predictor is b0 + bA×A + bM×M + bAM×A×M. Record any additional covariates and how predictions handle them before interpreting a real fitted model.
Build all four scenarios
Evaluate the linear predictor at A,M combinations 0,0; 1,0; 0,1; and 1,1. Convert each value η to probability using 1/(1+exp(−η)). The official SciPy expit documentation defines this inverse-logit transformation.
Keep the scenario labels next to the numbers. Within each modifier level, subtract the probability at A = 0 from that at A = 1. Then compare those two risk differences, preserving the order of subtraction throughout.
Recompute a fictional no-product-term example
Take invented coefficients b0 = −2, bA = 0.7, bM = 1, and bAM = 0. At M = 0, predicted probabilities are approximately 0.119203 for A = 0 and 0.214165 for A = 1, a difference of about 0.094962.
At M = 1, probabilities are approximately 0.268941 and 0.425557, a difference of about 0.156616. The second risk difference exceeds the first by about 0.061654, despite the product coefficient being zero. The nonlinear probability transformation explains this scale dependence. Use the logistic-scenario tool to reproduce the example.
Separate arithmetic from inference
These four probabilities come from supplied coefficients, not from a newly fitted dataset. The calculator supplies no uncertainty intervals, test of interaction, or evidence of causation. A nonzero difference between risk differences in this scenario is not proof of a meaningful effect modification in a study.
Use the scenario planning worksheet to record coefficient sources, coding, prediction population, and desired contrast. Real model-based uncertainty must account for the covariance among fitted coefficients. Comparing two separate significance labels is not a substitute for an appropriate contrast and interval.
Also distinguish predictions for a chosen covariate profile from averages standardized over a population. They can answer different questions. Avoid describing the displayed difference of differences as a causal difference-in-differences estimator without the design and assumptions that such an interpretation requires.
Finish with the four labeled probabilities, the explicitly named scale, and the uncertainty method appropriate to the actual model. This makes the interpretation reviewable rather than leaving readers to infer it from a product coefficient alone.
Source checked on 4 November 2026; fictional probabilities independently recalculated.