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

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

Examples

model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial") r2(model)
#> $R2_Tjur #> Tjur's R2 #> 0.4776926 #>
library(lme4) model <- lmer(Sepal.Length ~ Petal.Length + (1 | Species), data = iris) r2(model)
#> # R2 for Mixed Models #> #> Conditional R2: 0.969 #> Marginal R2: 0.658