R2_bayes: Bayesian R-squared for flexreg Objects

Description Usage Arguments Details References Examples

View source: R/R2_Bayes.R

Description

Bayesian version of R-squared for flexible regression models for continuous bounded or binomial data.

Usage

1
R2_bayes(model)

Arguments

model

an object of class `flexreg`, usually the result of flexreg or flexreg_binom.

Details

The function provides a Bayesian version of the R-squared measure, defined as the variance of the predicted values divided by itself plus the expected variance of the errors.

References

Andrew Gelman, Ben Goodrich, Jonah Gabry & Aki Vehtari (2019) R-squared for Bayesian Regression Models, The American Statistician, 73:3, 307-309, DOI: 10.1080/00031305.2018.1549100

Examples

1
2
3
data("Reading")
FB <- flexreg(accuracy ~ iq, Reading, type="FB", n.iter=1000)
hist(R2_bayes(FB))

FlexReg documentation built on Jan. 17, 2022, 5:06 p.m.