Pseudo-R-squared

From testwiki
Jump to navigation Jump to search

Template:Short description

In statistics, pseudo-R-squared values are used when the outcome variable is nominal or ordinal such that the coefficient of determination Template:Mvar2 cannot be applied as a measure for goodness of fit and when a likelihood function is used to fit a model.

In linear regression, the squared multiple correlation, Template:Mvar2 is used to assess goodness of fit as it represents the proportion of variance in the criterion that is explained by the predictors.[1] In logistic regression analysis, there is no agreed upon analogous measure, but there are several competing measures each with limitations.[1][2]

Some commonly used indices are examined in this article:

The pseudo Template:Mvar2 credited to McFadden (sometimes called likelihood ratio index[3] or log-likelihood ratio Template:Mvar[4]) is defined as[5]

RL2=1−ln⁡(LM)ln⁡(L0),

or expressed using deviance[1] rather than likelihood

RL2=D0−DMD0

and is preferred over Template:Mvar2Template:Sub by Paul D. Allison.[2] The two expressions Template:Mvar2Template:Sub and Template:Mvar2Template:Sub are then related respectively by,

RM2=1−(1L0)2(RL2)n[1.5em]RL2=−n2⋅ln⁡(1−RM2)ln⁡L0

This is the most analogous index to the squared multiple correlations in linear regression.[6] It represents the proportional reduction in the deviance wherein the deviance is treated as a measure of variation analogous but not identical to the variance in linear regression analysis.[6] One limitation of the likelihood ratio Template:Mvar2 is that it is not monotonically related to the odds ratio,[1] meaning that it does not necessarily increase as the odds ratio increases and does not necessarily decrease as the odds ratio decreases.

Adjusted

The adjusted version includes the number of predictors Template:Mvar as a penalisation term[7]

RL2=1−ln⁡(LM)−Kln⁡(L0),

Template:Mvar2M by Cox and Snell

Template:Mvar2M is an alternative index of goodness of fit described by Maddala in 1983 attributed to Cox and Snell[4] related to the Template:Mvar2 value from linear regression (sometimes called geometric mean squared improvement per observation Template:Mvar[4]).[2] It is given by:

RM2=1−(L0LM)2/n=1−exp⁡(2n(ln⁡(L0)−ln⁡(LM)))

where Template:Mvar and Template:Mvar are the likelihoods for the model being fitted and the null model, respectively, Template:Mvar denotes the natural logarithm, and Template:Mvar is the number of observations. Template:Mvar is the model with just an intercept.[4] The Cox and Snell index corresponds to the standard Template:Mvar2 in case of a linear model with normal error. In certain situations, Template:Mvar2M may be problematic as its maximum value is 1−L02/n which means it never takes the value of one. For example, for logistic regression, the upper bound is RM2≤0.75 for a symmetric marginal distribution of events and decreases further for an asymmetric distribution of events.[2]

Adjusted Template:Mvar2M by Nagelkerke

Nico Nagelkerke in a highly cited Biometrika paper,[8] provides a correction to the Cox and Snell Template:Mvar2 so that the maximum value is equal to 1. This correction is done by dividing Template:MvarM by its upper bound.[2][4]

RN2=[1−(L0LM)2/n]1−L02/n

Nevertheless, the Cox and Snell and likelihood ratio Template:Mvar2s show greater agreement with each other than either does with the adjusted Nagelkerke Template:Mvar2.[1] Of course, this might not be the case for values exceeding 0.75 as the Cox and Snell index is capped at this valueTemplate:Citation needed. The likelihood ratio Template:Mvar2 is often preferredTemplate:Citation needed to the alternatives as it is most analogous to Template:Mvar2 in linear regression, is independent of the base rate (both Cox and Snell and Nagelkerke Template:Mvar2s increase as the proportion of cases increase from 0 to 0.5) and varies between 0 and 1.

Tjur proposed an alternative measure of Template:Mvar2Template:Sub,[9] which is in two steps:

  1. For each level of the dependent variable, find the mean of the predicted probabilities of an event.
  2. Take the absolute value of the difference between these means

This quantity is not an R2 per se, however Tjur shows how it is related to usual R2 metrics.

Example

This displays R output from calculating pseudo-r-squared values using the "pscl" package by Simon Jackman. The pseudo-R-squared calculated using the formule named for McFadden is labelled “McFadden”. Next to this, the pseudo-r-squared by Cox and Snell is labelled “r2ML” and this type of pseudo-R-squared By Cox and Snell is sometimes simply called “ML”. The last value listed, labelled “r2CU” is the pseudo-r-squared by Nagelkerke and is the same as the pseudo-r-squared by Cragg and Uhler.

Interpretation

A word of caution is in order when interpreting pseudo-Template:Mvar2 statistics. The reason these indices of fit are referred to as pseudo Template:Mvar2 is that they do not represent the proportionate reduction in error as the Template:Mvar2 in linear regression does.[1] Linear regression assumes homoscedasticity, that the error variance is the same for all values of the criterion. Logistic regression will always be heteroscedastic – the error variances differ for each value of the predicted score. For each value of the predicted score there would be a different value of the proportionate reduction in error. Therefore, it is inappropriate to think of Template:Mvar2 as a proportionate reduction in error in a universal sense in logistic regression.[1]

See also

References

Template:Reflist

Template:Least squares and regression analysis

  1. ↑ 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Template:Cite book
  2. ↑ 2.0 2.1 2.2 2.3 2.4 Template:Cite web
  3. ↑ Hardin, J. W., Hilbe, J. M. (2007). Generalized linear models and extensions. USA: Taylor & Francis. Page 60, Google Books
  4. ↑ 4.0 4.1 4.2 4.3 4.4 Template:Cite journal
  5. ↑ Template:Cite journal
  6. ↑ 6.0 6.1 Template:Cite book Template:Page needed
  7. ↑ Template:Cite web
  8. ↑ Nagelkerke, N. J. D. (1991). A Note on a General Definition of the Coefficient of Determination. Biometrika, 78(3), 691–692. https://doi.org/10.2307/2337038
  9. ↑ Template:Cite journal