AI Glossary / Statistics and probability / Advanced
Binary regression
Definition
Binary regression models the relationship between explanatory variables and an outcome with two possible values, commonly encoded as zero and one. It usually estimates the conditional probability of one outcome rather than directly producing a yes-or-no decision. Logistic and probit regression are common members of this broader family.
What it means
The word binary describes the response variable, not the number or type of predictors. A binary regression can use several numeric and categorical predictors, interactions and transformed features.
A predicted probability is distinct from a classification decision. Turning the probability into a decision requires a threshold or another decision rule. The regression also describes an association conditional on its inputs; a coefficient does not automatically establish what would happen if someone intervened to change a predictor.
How it works
For an individual observation, a common model treats Y given its predictors as Bernoulli with probability p. A link function connects p to a predictor expression such as beta_0 + beta_1 x_1 + beta_2 x_2. Logistic regression uses the log-odds link log[p/(1-p)]. Probit regression instead uses the inverse standard-normal cumulative distribution function.
The chosen inverse link maps the predictor expression to a probability. Parameters are estimated from labeled observations, commonly by likelihood-based methods.
Grouped binomial regression can model counts of successes across several trials, while binary observations correspond to one trial each. The distinction matters when specifying sample sizes and interpreting an input proportion. Dependencies between repeated observations and inadequate predictor specifications also require attention; choosing a binary-response family does not resolve those issues automatically.
Three practical examples
- Completion forecasting: a team estimates the probability that a user completes a simulated workflow from characteristics measured before the outcome.
- Quality analysis: analysts examine how a binary pass/fail outcome is associated with recorded operating conditions, without treating every association as an intervention effect.
- Model comparison: researchers compare logistic and probit specifications using the same evaluation observations and assess probability quality as well as thresholded decisions.
Think of it this way
Imagine a dial that converts a combination of measured inputs into a probability between zero and one. The model determines how the dial responds to inputs. A separate switch decides what action to take at a chosen probability.
Worked example
Consider an original logistic binary regression for a hypothetical completion outcome Y. Let x be a numeric feature and suppose the stipulated model is log[p/(1-p)] = -log(4) + log(2) times x. These coefficients are supplied for illustration; they have not been estimated from a dataset.
Exponentiating both sides gives odds p/(1-p) = 2^x/4. At x = 0, the odds are 1/4, so p = (1/4)/(1+1/4) = 0.2. At x = 1, the odds are 1/2 and p = 1/3, approximately 0.3333. At x = 2, the odds are 1 and p = 0.5. At x = 3, the odds are 2 and p = 2/3, approximately 0.6667.
Each one-unit increase in x doubles the odds because the coefficient is log(2). It does not double the probability. The change from x = 0 to x = 1 raises probability by about 0.1333, whereas the change from x = 1 to x = 2 raises it by about 0.1667. A constant slope on the log-odds scale is not a constant slope on the probability scale.
At a decision threshold of 0.5, using the rule predict one when p is at least the threshold, the four predictions would be 0, 0, 1 and 1. At threshold 0.7, all four would be zero. The fitted probabilities remain unchanged; only the decision rule changes.
Suppose 30 future observations all have x = 1 and the model correctly specifies their marginal probabilities. The expected number of positive outcomes is 30 times 1/3 = 10. That expectation does not promise exactly ten positives. If those observations are also independent, the count has binomial variance 30 times (1/3) times (2/3) = 20/3. Independence is needed for this binomial count statement, not for adding the expectations.
Now consider reversing the response coding so that the former zero becomes one. The new event probability is 1-p, and its log-odds are the negative of the original log-odds. The coefficients become log(4) and -log(2). At x = 0, the predicted probability becomes 0.8, the complement of 0.2. The underlying observations have not changed, but the event being modeled has.
These calculations illustrate one logistic specification within binary regression. A probit model uses a different link and coefficient scale, so its coefficient should not be interpreted as the same log-odds multiplier.
Illustrative case study
Fictional company Cedar Analysis models whether a simulated task is completed. Its analysts define the positive outcome explicitly and separate predictors available before completion from information recorded afterward. They fit a candidate model and evaluate probabilities on held-out observations.
When presenting a positive coefficient, the team shows predicted probabilities over a relevant input range rather than claiming a fixed percentage-point increase. It chooses the decision threshold separately based on the task's objectives. This fictional workflow reports no measured predictive improvement or causal result.
Common misconceptions and mistakes
Binary regression does not require binary predictors and is not synonymous with a model containing exactly two variables. Logistic regression is one form, not the entire category.
A logistic coefficient operates on log-odds, so exponentiating it gives an odds multiplier rather than a probability multiplier. Reversing the positive-class encoding changes its interpretation. Another mistake is assuming that a good fit establishes causation or guarantees accurate probabilities outside the observed input range. Finally, ordinary linear regression on zero-one outcomes is a different specification and can produce predictions outside the probability interval.
Business use
Binary regression can support forecasting and analysis when an outcome has two defined categories. A useful report states the positive outcome, predictors, link, evaluation population and decision rule. It distinguishes probability estimates from operational choices and associations from causal claims.
People also ask
Must the predictors be zero or one?
No; predictors can take many forms.
Is every binary regression logistic?
No; probit and other specifications are possible.
Does probability 0.8 guarantee a positive outcome?
No; it is a probability estimate, not an individual certainty.
Check your understanding
What doubled for each unit of x?
Answer: The odds, not the probability.
Why did changing the threshold leave the model intact?
Answer: Thresholding is a separate decision rule.
Why did reversing labels reverse coefficient signs in the example?
Answer: The complementary event has reciprocal odds and opposite log-odds.
Related terms
- Logistic regression
- Binomial regression
- Odds ratio
- Classification threshold
- Probit regression
- Bernoulli distribution
- Link function
Learn next
Plot the example's probabilities across several x values and compare the changing probability increments with its constant log-odds slope.
More in Statistics and probability
- Betweensubjects designs - Between-subjects designs are study arrangements in which different participants experience the different levels of a factor.
- Bimodal - Bimodal describes a distribution with two distinct peaks, or modes. Values tend to concentrate around two regions rather than one.
- Binary cross-entropy - Binary cross-entropy, often abbreviated BCE, is a loss function for assessing predicted probabilities of a binary outcome.
- Binomial distribution - The binomial distribution describes the number of successes in a fixed number of independent trials when each trial has two possible outcomes and the same...
- Binomial test - A binomial test assesses a specified probability of success using a count of successes in a fixed number of independent binary trials with a common success...
- Birnbaum's theorem - Birnbaum's theorem is a foundational statistical result linking the sufficiency principle, the conditionality principle and the likelihood principle.
Sources
Statsmodels, Generalized Linear Models technical documentation, binomial family and link functions: https://www.statsmodels.org/stable/glm.html . The logistic coefficients, count calculation and company scenario are original illustrations.
Previous: Binary Ordered Compression for Unicode Next: Binary resolution