liveBook · Manning

Pseudo r-squared

As explained in Statistics Every Programmer Needs

Pseudo R-squared is a family of fit measures for logistic regression that quantify model fit using likelihood-based comparisons rather than explained variance.

Pseudo R-squared is a family of goodness-of-fit measures for logistic regression. Unlike linear-regression R-squared, it does not represent the proportion of variance explained; it evaluates how well the model explains a binary outcome. section 5.2.3

Statsmodels reports McFadden’s pseudo R-squared. It is calculated as 1 minus the model log-likelihood divided by the intercept-only model’s log-likelihood. The null model supplies a baseline, so a larger value indicates greater added predictive value from the independent variables and better fit. section 5.2.3

Interpret pseudo R-squared by:

  • Comparing the fitted model’s log-likelihood with the intercept-only model’s log-likelihood. section 5.2.3
  • Treating higher McFadden’s pseudo R-squared as evidence of better fit within comparable models. section 5.2.3
  • Using the metric to compare models fitted to the same data, while avoiding isolated interpretation of raw log-likelihoods. section 5.2.3

How Statistics Every Programmer Needs covers it

How deep it goes
Defines McFadden’s formula and explains its likelihood baseline, but does not develop other pseudo R-squared variants.
Examples
Uses fitted-model log-likelihood attributes and regression-table output as the main evaluation artifacts.
What it assumes
Assumes logistic regression and binary outcomes, while defining log-likelihood and the intercept-only baseline.
What you can do after
Evaluate logistic-regression fit and compare competing models through McFadden’s pseudo R-squared.
How it connects
Connects logistic regression with log-likelihood, null models, binary outcomes, and model comparison.

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.