Use logistic regression when the response variable is binary, for example whether a lecturer missed a deadline. It relates the event's log odds to one or more predictors, producing fitted probabilities between zero and one. Exponentiating a coefficient gives an odds ratio for a specified predictor change, conditional on the other model terms. An odds ratio is not generally a ratio of probabilities; the corresponding probability change depends on the starting probability and other predictors.
Report the outcome coding, estimated associations with confidence intervals, and relevant model checks. Sparse events, complete separation and dependent observations can make ordinary estimates or inferential procedures unreliable; repeated observations may need a generalized linear mixed model. For prediction, evaluate calibration and discrimination on data not used to tune the model. An adjusted association in an observational study does not automatically identify a causal effect.
Independence gives the log-likelihood
Differentiating yields the score equations
When a finite maximum-likelihood estimator exists, multiplying these equations by gives
The qualification about a finite estimator matters under complete separation in logistic regression, where coefficient estimates can escape to infinity.
The successful hard-margin fit proves that the transformed observations are separable. This creates complete separation in unpenalized logistic regression: scaling a separating coefficient vector continually raises the likelihood, so no finite maximum-likelihood estimate exists. The nearly singular observed information produces the enormous reported standard errors.
A ridge-penalized logistic regression, or equivalently a Bayesian logistic model with a proper Gaussian prior, gives finite, stable coefficients. Firth bias reduction is another standard remedy.
A binary logistic regression sets
and classifies by the sign of . Its unpenalized maximum-likelihood estimator minimizes the empirical logistic loss
The plotted data are complete separation data: there is a vector with every signed margin . For every finite , increasing strictly decreases each term of , and as . No finite parameter attains zero, so the unpenalized optimization has no solution.
Adding an penalty with , constraining , or using a finite stopping rule makes the problem attain a finite approximate solution. The penalized option is preferable because cross-validation can select the strength of regularization.