Learn R Programming

performance (version 0.12.1)

r2_kullback: Kullback-Leibler R2

Description

Calculates the Kullback-Leibler-divergence-based R2 for generalized linear models.

Usage

r2_kullback(model, ...)

# S3 method for glm r2_kullback(model, adjust = TRUE, ...)

Value

A named vector with the R2 value.

Arguments

model

A generalized linear model.

...

Additional arguments. Currently not used.

adjust

Logical, if TRUE (the default), the adjusted R2 value is returned.

References

Cameron, A. C. and Windmeijer, A. G. (1997) An R-squared measure of goodness of fit for some common nonlinear regression models. Journal of Econometrics, 77: 329-342.

Examples

Run this code
model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")
r2_kullback(model)

Run the code above in your browser using DataLab