Learn R Programming

psycho (version 0.4.91)

get_R2.stanreg: R2 or Bayesian Models.

Description

Computes R2 and LOO-adjusted R2.

Usage

# S3 method for stanreg
get_R2(fit, silent = FALSE, ...)

Arguments

fit

A stanreg model.

silent

If R2 not available, throw warning.

...

Arguments passed to or from other methods.

See Also

"bayes_R2.stanreg"

Examples

Run this code
# NOT RUN {
library(psycho)
library(rstanarm)

fit <- rstanarm::stan_glm(Adjusting ~ Tolerating, data = psycho::affective)

get_R2(fit)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab