Tools › Statistics › Regression and Modelling › Logistic Regression and Classification › Example

UCLA graduate admissions: logistic regression of admit on GRE, GPA and institution rank (R's glm output reproduced)

ToolLogistic Regression and Classification
SourceUCLA Statistical Consulting Group (2021). Logit Regression: R Data Analysis Examples. Office of Advanced Research Computing, University of California, Los Angeles (the admissions data binary.csv, 400 applicants; the printed summary(mylogit), confint, confint.default, exp(coef), wald.test and predict output).
LevelUndergraduate

Problem

For 400 applicants to graduate school the record holds whether each was admitted (admit 0/1), the GRE score, the GPA and the rank of the undergraduate institution (1 highest to 4). Fit the logistic regression of admission on GRE, GPA and rank as a categorical predictor with rank 1 as the reference; report the coefficients with their standard errors, Wald z and p-values, the Wald and profile-likelihood 95 % intervals, the odds ratios, the deviances and AIC, the likelihood-ratio test against the null model, and the predicted probability of admission for an applicant with the mean GRE and GPA at each rank and for one with GRE 200 at rank 1.

Inputs to Enter

  • Model: binary logistic (logit link); Data Set: Graduate admissions (UCLA, 400); response admit, predictors gre gpa rank, categorical rank
  • Confidence 95 %, profile intervals on, cutoff 0.5, 10 Hosmer–Lemeshow groups, 10 folds with seed 20261111
  • New rows: 587.7 3.3899 1 / 2 / 3 / 4 (the mean GRE and GPA at each rank) and 200 3.3899 1
Open the Logistic Regression and Classification tool (loaded with this example)

Answers

  • Coefficients (SE): intercept −3.98998 (1.13995), gre 0.002264 (0.001094), gpa 0.80404 (0.33182), rank2 −0.67544 (0.31649), rank3 −1.34020 (0.34531), rank4 −1.55146 (0.41783); z −3.50, 2.07, 2.42, −2.13, −3.88, −3.71; p 0.00047, 0.0385, 0.0154, 0.0328, 0.00010, 0.00020 (page: identical)
  • Null deviance 499.98 on 399 df, residual deviance 458.52 on 394 df, AIC 470.5, log-likelihood −229.26, 4 Fisher scoring iterations; LR = 41.46 on 5 df, p = 7.58 × 10⁻⁸; McFadden 0.0829, Cox–Snell 0.0985, Nagelkerke 0.1380
  • Profile-likelihood 95 % limits: intercept −6.2715 / −1.7925, gre 0.000138 / 0.004436, gpa 0.1603 / 1.4641, rank2 −1.3009 / −0.0567, rank3 −2.0277 / −0.6704, rank4 −2.4000 / −0.7535 (page −6.271620 / −1.79255 …); Wald limits −6.22424 / −1.75572 … (page identical)
  • Odds ratios: gre 1.0023, gpa 2.2345, rank2 0.5089, rank3 0.2618, rank4 0.2119 (profile limits 1.00014–1.0044, 1.1739–4.324, 0.2723–0.945, 0.1316–0.512, 0.0907–0.471)
  • Predicted probability at the mean GRE and GPA: rank 1 0.517, rank 2 0.352, rank 3 0.219, rank 4 0.185; GRE 200 at rank 1: η = −0.811, SE 0.515, p = 0.308 with 95 % limits 0.139 to 0.549 (page: identical)
  • Hosmer–Lemeshow χ² = 11.09 on 8 df, p = 0.197; at cutoff 0.5 accuracy 0.710 (sensitivity 0.236, specificity 0.930, precision 0.612, F1 0.341); AUC 0.6928; 10-fold cross-validated accuracy 0.7075

Notes

The tool's default inputs are this case; press Submit. R's confint profiles on a grid and interpolates, so its printed profile limits differ from the exact roots in the fifth significant figure. The Hosmer–Lemeshow, ROC, classification and cross-validation values are not on the page; they are checked against an independent numpy re-implementation in References/Logistic-Regression/checks/ by test_logistic_regression.php (776 checks), which also reproduces the page's probit fit, the ordinal (polr) and multinomial (multinom) examples of the companion UCLA pages.