pR2: compute various pseudo-R2 measures

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/pseudoRSq.R

Description

compute various pseudo-R2 measures for various GLMs

Usage

1
pR2(object, ...)

Arguments

object

a fitted model object for which logLik, update, and model.frame methods exist (e.g., an object of class glm, polr, or mulitnom)

...

additional arguments to be passed to or from functions

Details

Numerous pseudo r-squared measures have been proposed for generalized linear models, involving a comparison of the log-likelihood for the fitted model against the log-likelihood of a null/restricted model with no predictors, normalized to run from zero to one as the fitted model provides a better fit to the data (providing a rough analogue to the computation of r-squared in a linear regression).

Value

A vector of length 6 containing

llh

The log-likelihood from the fitted model

llhNull

The log-likelihood from the intercept-only restricted model

G2

Minus two times the difference in the log-likelihoods

McFadden

McFadden's pseudo r-squared

r2ML

Maximum likelihood pseudo r-squared

r2CU

Cragg and Uhler's pseudo r-squared

Author(s)

Simon Jackman simon.jackman@sydney.edu.au

References

Long, J. Scott. 1997. Regression Models for Categorical and Limited Dependent Variables. Sage. pp104-106.

See Also

extractAIC, logLik

Examples

1
2
3
4
5
6
7
data(admit)
## ordered probit model
op1 <- MASS::polr(score ~ gre.quant + gre.verbal + ap + pt + female,
            Hess=TRUE,
            data=admit,
            method="probit")
pR2(op1)   

Example output

Classes and Methods for R developed in the
Political Science Computational Laboratory
Department of Political Science
Stanford University
Simon Jackman
hurdle and zeroinfl functions by Achim Zeileis
         llh      llhNull           G2     McFadden         r2ML         r2CU 
-106.5088203 -151.0299826   89.0423245    0.2947836    0.5682989    0.6032041 

pscl documentation built on March 26, 2020, 7:36 p.m.