Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

r2_loo

LOO-adjusted R2


Description

Compute LOO-adjusted R2.

Usage

r2_loo(model, verbose = TRUE)

Arguments

model

A Bayesian regression model.

verbose

Toggle off warnings.

Details

Unlike r2_bayes, which returns an "unadjusted" R2 value, r2_loo() calculates a LOO-adjusted R2, which comes conceptionally closer to an "adjusted" R2 measure.

Value

The LOO-adjusted R2 for model, as numeric value.

Examples

if (require("rstanarm")) {
  model <- stan_glm(mpg ~ wt + cyl, data = mtcars, chains = 1, iter = 500, refresh = 0)
  r2_loo(model)
}

performance

Assessment of Regression Models Performance

v0.7.1
GPL-3
Authors
Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>), Dominique Makowski [aut, ctb] (<https://orcid.org/0000-0001-5375-9967>), Mattan S. Ben-Shachar [aut, ctb] (<https://orcid.org/0000-0002-4287-4801>), Indrajeet Patil [aut, ctb] (<https://orcid.org/0000-0003-1995-6531>), Philip Waggoner [aut, ctb] (<https://orcid.org/0000-0002-7825-7573>), Vincent Arel-Bundock [ctb] (<https://orcid.org/0000-0003-2042-7063>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.