Skip to contents

Thin extender over performance::r2 returning the appropriate R-squared (Nakagawa, McFadden, Tjur, ...) for a supported fitted model.

Usage

morie_performance_r2(model, ...)

Arguments

model

A fitted model object supported by performance.

...

Further arguments forwarded to performance::r2 (e.g. tolerance, ci, verbose).

Value

A list with $method = "performance::r2" and $raw (the upstream R-squared object).

Examples

if (requireNamespace("performance", quietly = TRUE)) {
  set.seed(1)
  df <- data.frame(y = rnorm(50), x = rnorm(50))
  morie_performance_r2(stats::lm(y ~ x, df))
}
#> $method
#> [1] "performance::r2"
#> 
#> $raw
#> # R2 for Linear Regression
#>        R2: 0.002
#>   adj. R2: -0.019
#>