Learn R Programming

performance (version 0.4.3)

r2: Compute the model's R2

Description

Calculate the R2 value for different model objects. Depending on the model, R2, pseudo-R2 or marginal / adjusted R2 values are returned.

Usage

r2(model, ...)

Arguments

model

A statistical model.

...

Currently not used.

Value

Returns a list containing values related to the most appropriate R2 for the given model. See the list below:

See Also

r2_bayes, r2_coxsnell, r2_kullback, r2_loo, r2_mcfadden, r2_nagelkerke, r2_nakagawa, r2_tjur, r2_xu and r2_zeroinflated.

Examples

Run this code
# NOT RUN {
model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")
r2(model)

if (require("lme4")) {
  model <- lmer(Sepal.Length ~ Petal.Length + (1 | Species), data = iris)
  r2(model)
}
# }

Run the code above in your browser using DataLab