liveBook · Manning

McFadden's pseudo R-squared

As explained in Statistics Every Programmer Needs

McFadden's pseudo R-squared is a likelihood-based measure of how much a fitted discrete-choice model improves over an intercept-only null model.

McFadden's pseudo R-squared measures how much a fitted logistic regression improves on an intercept-only null model when predicting a binary outcome. Unlike linear-regression R-squared, it is likelihood-based rather than a proportion of variance explained. section 5.2.3

Compute it as 1 − (model log-likelihood ÷ null-model log-likelihood). The fitted model and null-model log-likelihoods are available as model attributes and appear in the regression table. Larger values indicate greater improvement over the baseline, although log-likelihoods and pseudo R-squared values are most useful when comparing models fitted to the same data. section 5.2.3

Use the metric as one part of logistic-regression evaluation:

  • Compare competing models using their likelihood-based improvement over the same intercept-only baseline. section 5.2.3
  • Pair it with the likelihood-ratio test p-value, predictor p-values, and classification measures such as accuracy and ROC area. section 5.3
  • Do not interpret it as the percentage of binary-outcome variance explained, as with ordinary linear-regression R-squared. section 5.2.3

How Statistics Every Programmer Needs covers it

How deep it goes
Defines the likelihood ratio, identifies fitted-model attributes, and explains comparison limits without deriving likelihood estimation.
Examples
Uses statsmodels regression tables and fitted-model log-likelihood attributes to evaluate binary-outcome models.
What it assumes
Assumes logistic regression, binary outcomes, fitted models, and log-likelihood; distinguishes pseudo R-squared from linear-regression R-squared.
What you can do after
Evaluate logistic-regression fit and compare models using their improvement over a shared null-model likelihood.
How it connects
Connects logistic regression with log-likelihood, null models, likelihood-ratio significance, predictor p-values, and classification metrics.

Also explained in

Compare how 2 books explain McFadden's pseudo R-squared →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.