Binary logistic regression: predicting yes / no outcomes

An outcome that is one of two things — a seed germinates or not, a sample passes or fails — cannot be fitted with ordinary regression: the answer is a probability, bounded by 0 and 1. Logistic regression models the log-odds of the outcome as a linear function of the predictors, so each coefficient says how the odds change per unit of that predictor.

The data

One row per observation: the outcome as 0 / 1, then the predictors (here the classic mtcars question: is a car’s transmission manual, from its weight and horsepower?):

Caramwthp
Mazda RX412.620110
Datsun 71012.32093
Hornet 4 Drive03.215110
Volvo 142E12.780109

Logistic layout: the 0 / 1 outcome column, then one column per predictor; 32 rows in the full dataset.

In MinutePlot

Choose Binary logistic regression, mark the outcome column, run. The table gives each coefficient on the log-odds scale with its standard error, z and p, plus the odds ratio with its confidence interval; the fit summary reports the deviances, AIC, McFadden’s pseudo-R² and the likelihood-ratio test of the whole model.

The result

Weight: −8.08 log-odds per 1000 lb (p = 0.008) — heavier cars are far less likely to be manual; horsepower: +0.036 per hp (p = 0.041). Residual deviance 10.1 against a null deviance of 43.2: the two predictors explain most of the pattern (McFadden R² = 0.77).

ROC curve of the logistic model with its AUC

The figure MinutePlot produces for a model with more than one predictor: the ROC curve with its AUC (a single-predictor model shows the probability curve instead).

Report it like this

“The odds of a manual transmission fell with weight (β = −8.08, p = 0.008) and rose with horsepower (β = 0.036, p = 0.041); logistic regression, likelihood-ratio test p < 0.001.”

Try it yourself — in a minute. Paste the table above into MinutePlot, press Confirm and Analyze, and you will get this exact analysis and a publication-ready figure with the letters placed for you. Open MinutePlot in your browser — free 14-day trial, no card needed.
References
  1. Hosmer, D. W., Lemeshow, S. & Sturdivant, R. X. (2013). Applied Logistic Regression, 3rd ed. Wiley.