
Last chance! 50% off unlimited learning
Sale ends in
Calculates the Kullback-Leibler-divergence-based R2 for generalized linear models.
r2_kullback(model, adjust = TRUE)
A named vector with the R2 value.
A generalized linear model.
Logical, if TRUE
(the default), the adjusted R2 value is
returned.
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.
model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")
r2_kullback(model)
Run the code above in your browser using DataLab