Binary logistic regression
MinutePlot® and R on the same data. MinutePlot version 1.0.0; R 4.5.2.
Dataset
- mtcars (am, wt, hp) — 32 cars from the 1974 Motor Trend road tests: transmission (am: 0 automatic, 1 manual), weight (wt, 1000 lb) and gross horsepower (hp) (R: datasets::mtcars).
- Data file (the same format serves MinutePlot and R): mtcars_am_wt_hp.csv — one column per variable; paste it into the app, and keep it in the R script’s folder.
- R built-in: the script uses mtcars.
Setup
In MinutePlot:
- Workbench → Binary logistic regression → paste mtcars_am_wt_hp.csv → Preview data → tick first column is sample names (the car column) → outcome column am, predictors wt and hp → Confirm → Fit logistic model.
In R:
- Base R only; then run
mtcars_logistic.Rtop to bottom (source it, or paste it into the console) with the R data file in the same folder. - R 4.5.2 and the package versions in the page header; each script prints the versions it runs under.
The analysis:
- Binary logistic regression of am on wt and hp (maximum likelihood, MinutePlot’s iteratively reweighted least squares). R reference: glm(am ~ wt + hp, family = binomial).
- Coefficients on the log-odds scale with standard errors and two-sided Wald p-values; the fit summary as MinutePlot reports it: residual deviance (−2 log-likelihood), null deviance, AIC, log-likelihood, McFadden’s pseudo-R² and the likelihood-ratio test of the model.
Side-by-side results
Coefficients (log-odds)
MinutePlot®
| Term | Estimate | SE | p |
|---|---|---|---|
| (Intercept) | 18.8663 | 7.4436 | 0.0113 |
| wt | -8.0835 | 3.0687 | 0.0084 |
| hp | 0.0363 | 0.0177 | 0.0409 |
R
| Term | Estimate | SE | p |
|---|---|---|---|
| (Intercept) | 18.8663 | 7.4436 | 0.0113 |
| wt | -8.0835 | 3.0687 | 0.0084 |
| hp | 0.0363 | 0.0177 | 0.0409 |
R values: verified in R 4.5.2 (see the verdict).
Fit summary
MinutePlot®
| Residual deviance | Null deviance | AIC | Log-likelihood | McFadden R² | LR-test p |
|---|---|---|---|---|---|
| 10.059 | 43.230 | 16.059 | -5.030 | 0.7673 | < 0.0001 |
R
| Residual deviance | Null deviance | AIC | Log-likelihood | McFadden R² | LR-test p |
|---|---|---|---|---|---|
| 10.059 | 43.230 | 16.059 | -5.030 | 0.7673 | < 0.0001 |
R values: verified in R 4.5.2 (see the verdict).
Verdict
Coefficients 18.8663, −8.0835, 0.0363 with SE 7.4436, 3.0687, 0.0177 and residual deviance 10.059, null deviance 43.230, AIC 16.059 -- identical to R’s glm(am ~ wt + hp, family = binomial); McFadden’s R² derived from R’s log-likelihoods.
R script
mtcars_logistic.R — each script loads its data, prints its versions and the R-side tables shown above, in page order; no plotting.
R values verified in R 4.5.2 (emmeans 2.0.4, multcomp 1.4-32, multcompView 0.1-12, ez 4.5.0, Hmisc 5.3.0, pls 2.9.0, drc 3.0-1, car 3.1-5) on 16–17 September 2026.