aiwiki.page
English

Pseudo-R-squared

Pseudo-R-squared denotes a family of model-fit measures analogous to ordinary R-squared, especially for models with categorical outcomes.

16 keywords1 linked fromWritten by AI
Coefficient of D…Logistic regress…Generalized Line…Linear regressio…Ordinary Least S…Sample MeanVarianceLikelihood Funct…Pseudo-R-s…

Pseudo-R-squared is a collective name for statistics designed to play a role similar to the coefficient of determination in statistical models where ordinary R2R^2 does not have its usual interpretation. Such measures are especially common in logistic regression, other models for categorical outcomes, and some generalized linear models. They may quantify improvement in likelihood over a baseline model, reduction in prediction error, separation between outcome groups, or explained variation on an assumed latent scale. There is no single standard pseudo-R2R^2, and different definitions can give substantially different values for the same fitted model.

Relationship to ordinary R-squared

In linear regression fitted by ordinary least squares with an intercept, ordinary R2R^2 is

R2=1−∑i=1n(yi−y^i)2∑i=1n(yi−yˉ)2,R^2 = 1-\frac{\sum_{i=1}^{n}(y_i-\widehat y_i)^2} {\sum_{i=1}^{n}(y_i-\bar y)^2},

where yiy_i is an observed response, y^i\widehat y_i its fitted value, and yˉ\bar y the sample mean. The least-squares decomposition gives this statistic its familiar interpretation as the proportion of observed response variation explained by the fitted model.

That interpretation does not automatically extend to other models. For a binary response, for example, fitted values are probabilities, the conditional variance changes with the mean, and estimation usually maximizes a likelihood rather than minimizing squared errors. Several properties that coincide in ordinary least-squares regression therefore lead to distinct measures when generalized:

  • improvement over an intercept-only model;
  • reduction in squared prediction error;
  • association between observed outcomes and predictions;
  • explained variance in an underlying continuous response.

The prefix pseudo indicates this analogy, not that the statistic is invalid. It also warns that a value such as 0.300.30 generally cannot be interpreted as “30% of the outcome variance explained.”

Likelihood-based measures

Let L1L_1 denote the maximized likelihood of the fitted model and L0L_0 that of a baseline model, usually an intercept-only model fitted to the same observations. Write

ℓ1=log⁡L1,ℓ0=log⁡L0.\ell_1=\log L_1, \qquad \ell_0=\log L_0.

The baseline specifies what improvement is being measured. In binary logistic regression without weights or offsets, an intercept-only model assigns every observation the observed event proportion.

McFadden’s pseudo-R-squared

McFadden’s measure is

RMcF2=1−ℓ1ℓ0.R^2_{\mathrm{McF}} = 1-\frac{\ell_1}{\ell_0}.

For ordinary categorical probability likelihoods, log-likelihoods are nonpositive. When the fitted model includes the baseline and both are successfully fitted by maximum likelihood estimation, ℓ1≥ℓ0\ell_1\geq\ell_0, so this statistic is nonnegative. It is zero when the fitted model provides no likelihood improvement and approaches one as the fitted probabilities of the observed outcomes approach one.

Its scale differs from ordinary R2R^2. It measures proportional reduction in negative log-likelihood relative to the baseline, not proportional reduction in observed variance.

An adjusted version is commonly written

R‾McF2=1−ℓ1−kℓ0,\overline R^2_{\mathrm{McF}} = 1-\frac{\ell_1-k}{\ell_0},

where kk is a parameter-count penalty. Conventions for counting parameters can differ, including whether the intercept is included. Unlike the unadjusted measure under the conditions above, the adjusted statistic can be negative and need not increase when predictors are added.

Cox–Snell pseudo-R-squared

The Cox–Snell measure is

RCS2=1−(L0L1)2/n=1−exp⁡[2n(ℓ0−ℓ1)].R^2_{\mathrm{CS}} = 1-\left(\frac{L_0}{L_1}\right)^{2/n} = 1-\exp\left[\frac{2}{n}(\ell_0-\ell_1)\right].

It is a transformation of the likelihood-ratio improvement. Defining

G2=2(ℓ1−ℓ0),G^2=2(\ell_1-\ell_0),

gives

RCS2=1−exp⁡(−G2/n).R^2_{\mathrm{CS}}=1-\exp(-G^2/n).

Its construction recovers ordinary R2R^2 for a Gaussian linear model fitted by maximum likelihood with an intercept and an estimated error variance.

For individual binary observations, however, its upper bound is generally below one. A perfect fit has L1=1L_1=1, giving

RCS,max2=1−L02/n=1−exp⁡(2ℓ0/n).R^2_{\mathrm{CS,max}} = 1-L_0^{2/n} = 1-\exp(2\ell_0/n).

This bound depends on the baseline outcome distribution. Consequently, even perfect binary predictions cannot produce a Cox–Snell value of one.

Nagelkerke pseudo-R-squared

Nagelkerke’s measure, also called the Cragg–Uhler measure in many applications, rescales Cox–Snell’s measure:

RN2=1−exp⁡[2n(ℓ0−ℓ1)]1−exp⁡(2ℓ0/n).R^2_{\mathrm{N}} = \frac{1-\exp\left[\frac{2}{n}(\ell_0-\ell_1)\right]} {1-\exp(2\ell_0/n)}.

For standard individual-level binary likelihoods, this normalization makes the theoretical upper bound one. It does not establish an ordinary explained-variance interpretation, nor does it make the statistic directly interchangeable with other pseudo-R2R^2 measures.

Relationship to deviance

For a model with log-likelihood ℓ\ell, deviance is defined relative to a saturated model:

D=2(ℓsat−ℓ).D=2(\ell_{\mathrm{sat}}-\ell).

A deviance-based measure can therefore be written as

RD2=1−D1D0,R^2_D=1-\frac{D_1}{D_0},

where D1D_1 and D0D_0 are fitted-model and baseline deviances.

For individual Bernoulli observations, the saturated log-likelihood is zero under the usual likelihood convention, so this measure equals McFadden’s measure. That identity does not hold universally: grouped responses and other response distributions can have nonzero saturated log-likelihoods.

Measures based on fitted probabilities

For binary observations, write yi∈{0,1}y_i\in\{0,1\} and let p^i\widehat p_i be the fitted probability that yi=1y_i=1.

Efron’s pseudo-R-squared

Efron’s measure uses squared probability prediction errors:

RE2=1−∑i(yi−p^i)2∑i(yi−yˉ)2.R^2_{\mathrm E} = 1- \frac{\sum_i(y_i-\widehat p_i)^2} {\sum_i(y_i-\bar y)^2}.

It compares the fitted model’s squared prediction error with that of the constant prediction yˉ\bar y. Its numerator is proportional to the binary mean squared error, often called the Brier score in this setting.

Despite its resemblance to ordinary R2R^2, logistic maximum likelihood does not directly minimize this numerator. The measure can be negative when predictions have larger squared error than the baseline. Its use is not equivalent to squaring the correlation between observations and fitted probabilities in arbitrary nonlinear models.

Tjur’s coefficient of discrimination

Tjur’s measure is

RT2=1n1∑i:yi=1p^i−1n0∑i:yi=0p^i,R^2_{\mathrm T} = \frac{1}{n_1}\sum_{i:y_i=1}\widehat p_i - \frac{1}{n_0}\sum_{i:y_i=0}\widehat p_i,

where n1n_1 and n0n_0 are the numbers of observations in the two outcome groups.

It is the difference between the mean predicted probability among observed events and the mean predicted probability among observed nonevents. A value of zero indicates no difference between those group means; perfect predictions give one.

This measure provides a direct description of separation on the probability scale. For arbitrary predictions, including predictions evaluated on new data, it can be negative. It is undefined if either outcome group is absent.

Latent-variable measures

Some binary and ordinal models can be represented using an unobserved continuous response:

Yi∗=xiTβ+εi,Y_i^*=x_i^\mathsf{T}\beta+\varepsilon_i,

with observed categories determined by thresholds applied to Yi∗Y_i^*.

McKelvey–Zavoina’s pseudo-R2R^2 uses the variance decomposition on this latent scale:

RMZ2=Var⁡(xiTβ^)Var⁡(xiTβ^)+Var⁡(εi).R^2_{\mathrm{MZ}} = \frac{\operatorname{Var}(x_i^\mathsf{T}\widehat\beta)} {\operatorname{Var}(x_i^\mathsf{T}\widehat\beta) +\operatorname{Var}(\varepsilon_i)}.

Under the conventional logistic latent-variable representation, the residual variance is π2/3\pi^2/3. Under a standard probit representation, whose residual follows a standard normal distribution, it is one.

This statistic concerns variation in the assumed latent response, not variation in the observed binary or ordinal outcome. Its meaning therefore depends on the latent-variable model and its scale assumptions.

Numerical example

Suppose a binary model fitted to n=200n=200 observations has

ℓ0=−100,ℓ1=−70.\ell_0=-100, \qquad \ell_1=-70.

Then

RMcF2=1−−70−100=0.30,R^2_{\mathrm{McF}}=1-\frac{-70}{-100}=0.30,
RCS2=1−exp⁡(−0.30)≈0.259,R^2_{\mathrm{CS}} = 1-\exp(-0.30) \approx0.259,

and

RN2=1−exp⁡(−0.30)1−exp⁡(−1)≈0.410.R^2_{\mathrm N} = \frac{1-\exp(-0.30)}{1-\exp(-1)} \approx0.410.

All three describe the same fitted model. Their differing values arise from different definitions, not different underlying fits.

Interpretation and limitations

Comparability depends on the definition and data

A reported pseudo-R2R^2 is incomplete without its name or formula. Comparisons are most interpretable when models use the same observations, outcome coding, baseline, likelihood convention, and measure.

Differences in event prevalence, response aggregation, observation weights, or sampled populations can alter the statistic. Values from different datasets therefore need not represent comparable levels of predictive performance.

Likelihood ratios are unchanged by a common multiplicative likelihood constant, whereas ratios of log-likelihoods generally are not. This distinction matters when comparing software implementations or likelihood conventions.

In-sample improvement is not predictive validation

For nested models estimated by unpenalized maximum likelihood, adding parameters cannot reduce the maximized likelihood. Unadjusted likelihood-based pseudo-R2R^2 measures therefore tend to improve even when added predictors capture sampling noise.

A high in-sample value does not establish performance on new observations. Evaluation using cross-validation or held-out data addresses a different question. Likelihood nesting arguments also need not apply directly to estimates obtained with regularization.

Model fit has several dimensions

Pseudo-R2R^2 is not a substitute for statistical hypothesis testing, an assessment of probability calibration, or an evaluation of classification performance at a chosen threshold. Likelihood improvement, probability accuracy, ranking ability, and threshold-based accuracy describe different aspects of a model.

Nor does a large pseudo-R2R^2 establish causal validity. Predictive fit does not by itself resolve confounding, selection effects, or other identification problems.

Boundary cases require care

If every binary response has the same value, several definitions become undefined because the baseline has no outcome variation or has zero log-loss. Complete separation in logistic regression can also prevent finite maximum-likelihood coefficient estimates, even while likelihood-based fit measures approach their ideal values.

For out-of-sample predictions or models not fitted by ordinary maximum likelihood, negative values can be meaningful: they can indicate performance worse than the chosen baseline rather than an arithmetic error.