Learn R Programming

performance (version 0.1.0)

r2_loo: LOO-adjusted R2

Description

Compute LOO-adjusted R2.

Usage

r2_loo(model)

Arguments

model

A Bayesian regression model.

Value

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

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.

Examples

Run this code
# NOT RUN {
library(rstanarm)

model <- stan_glm(mpg ~ wt + cyl, data = mtcars, chains = 1, iter = 500)
r2_loo(model)

# }

Run the code above in your browser using DataLab