Learn R Programming

bistablehistory (version 1.1.2)

bayes_R2: Computes R-squared using Bayesian R-squared approach.

Description

For detail refer to: Andrew Gelman, Ben Goodrich, Jonah Gabry, and Aki Vehtari (2018). R-squared for Bayesian regression models. The American Statistician tools:::Rd_expr_doi("10.1080/00031305.2018.1549100") and https://avehtari.github.io/bayes_R2/bayes_R2.html

Usage

# S3 method for cumhist
bayes_R2(object, summary = TRUE, probs = c(0.055, 0.945), ...)

Value

vector of values or a data.frame with summary

Arguments

object

An object of class cumhist

summary

Whether summary statistics should be returned instead of raw sample values. Defaults to TRUE

probs

The percentiles used to compute summary, defaults to 89% credible interval.

...

Unused.

Examples

Run this code
# \donttest{
br_fit <- fit_cumhist(br_singleblock, state = "State", duration = "Duration")
bayes_R2(br_fit)
# }

Run the code above in your browser using DataLab