Regression coefficient to evaluate goodness-of-fit in a given model when ordinary least squares (OLS) are not available. The algorithm computes estimates from the maximum likelihood through an iterative process. These estimates are called 'pseudo R-squared' because they look like 'R-squared' in the sense that they are on a similar scale (from 0 to 1), with higher values indicating better model fit.

pseudoR2(object, ...)

# Default S3 method
pseudoR2(object, ...)

# S3 method for class 'pltree'
pseudoR2(object, newdata = NULL, ...)

# S3 method for class 'bttree'
pseudoR2(object, ...)

Arguments

object

a model object of class glm, gnm, lm, pltree or bttree

...

additional arguments affecting the R-squared produced

newdata

a data.set with testing data

Value

A data frame containing the pseudo R-squared coefficients:

logLik

log-likelihood

logLikNull

Null log-likelihood

MaxLik

maximum likelihood pseudo R-squared

CraggUhler

Cragg and Uhler's pseudo R-squared

McFadden

McFadden pseudo R-squared

References

Agresti A. (2002). Categorical Data Analysis. John Wiley & Sons, Inc., Hoboken, NJ, USA. doi:10.1002/0471249688

Hunter D. R. (2004). The Annals of Statistics, 32(1), 384–406. http://www.jstor.org/stable/3448514

Cragg, J. G., & Uhler, R. S. (1970). The Canadian Journal of Economics 3(3), 386-406. doi:10.2307/133656

McFadden, D. (1973). Conditional logit analysis of qualitative choice behavior.

See also

Other goodness-of-fit functions: kendallTau(), kendallW()

Author

Kauê de Sousa and Jacob van Etten

Examples


data("airquality")

mod = glm(Temp ~ Wind + Solar.R,
           data = airquality,
           family = poisson())

pseudoR2(mod)