Diff of /man/bayes_R2.hsstan.Rd [000000] .. [ede2d4]

Switch to unified view

a b/man/bayes_R2.hsstan.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/postestimation.R
3
\name{bayes_R2.hsstan}
4
\alias{bayes_R2.hsstan}
5
\alias{bayes_R2}
6
\alias{loo_R2.hsstan}
7
\alias{loo_R2}
8
\title{Bayesian and LOO-adjusted R-squared}
9
\usage{
10
\method{bayes_R2}{hsstan}(object, prob = 0.95, summary = TRUE, ...)
11
12
\method{loo_R2}{hsstan}(object, prob = 0.95, summary = TRUE, ...)
13
}
14
\arguments{
15
\item{object}{An object of class \code{hsstan}.}
16
17
\item{prob}{Width of the posterior interval (0.95, by default). It is
18
ignored if \code{summary=FALSE}.}
19
20
\item{summary}{Whether a summary of the distribution of the R-squared
21
should be returned rather than the pointwise values (\code{TRUE} by
22
default).}
23
24
\item{...}{Currently ignored.}
25
}
26
\value{
27
The mean, standard deviation and posterior interval of R-squared if
28
\code{summary=TRUE}, or a vector of R-squared values with length equal to
29
the size of the posterior sample if \code{summary=FALSE}.
30
}
31
\description{
32
Compute the Bayesian and the LOO-adjusted R-squared from the posterior
33
samples. For Bayesian R-squared it uses the modelled residual variance
34
(rather than the variance of the posterior distribution of the residuals).
35
The LOO-adjusted R-squared uses Pareto smoothed importance sampling LOO
36
residuals and Bayesian bootstrap.
37
}
38
\examples{
39
\dontshow{utils::example("hsstan", echo=FALSE)}
40
\dontshow{oldopts <- options(mc.cores=2)}
41
# continued from ?hsstan
42
bayes_R2(hs.biom)
43
loo_R2(hs.biom)
44
\dontshow{options(oldopts)}
45
46
}
47
\references{
48
Andrew Gelman, Ben Goodrich, Jonah Gabry and Aki Vehtari (2019),
49
R-squared for Bayesian regression models,
50
\emph{The American Statistician}, 73 (3), 307-309.
51
\doi{10.1080/00031305.2018.1549100}
52
53
Aki Vehtari, Andrew Gelman, Ben Goodrich and Jonah Gabry (2019),
54
Bayesian R2 and LOO-R2.
55
\url{https://avehtari.github.io/bayes_R2/bayes_R2.html}
56
}