https://github.com/cran/bayestestR
Raw File
Tip revision: 79b3ea026adbb877bc1921a9cf1ea0eae067cb63 authored by Dominique Makowski on 12 February 2024, 11:40:02 UTC
version 0.13.2
Tip revision: 79b3ea0
sensitivity_to_prior.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sensitivity_to_prior.R
\name{sensitivity_to_prior}
\alias{sensitivity_to_prior}
\alias{sensitivity_to_prior.stanreg}
\title{Sensitivity to Prior}
\usage{
sensitivity_to_prior(model, ...)

\method{sensitivity_to_prior}{stanreg}(model, index = "Median", magnitude = 10, ...)
}
\arguments{
\item{model}{A Bayesian model (\code{stanreg} or \code{brmsfit}).}

\item{...}{Arguments passed to or from other methods.}

\item{index}{The indices from which to compute the sensitivity. Can be one or
multiple names of the columns returned by \code{describe_posterior}. The case is
important here (e.g., write 'Median' instead of 'median').}

\item{magnitude}{This represent the magnitude by which to shift the
antagonistic prior (to test the sensitivity). For instance, a magnitude of
10 (default) means that the mode wil be updated with a prior located at 10
standard deviations from its original location.}
}
\description{
Computes the sensitivity to priors specification. This represents the
proportion of change in some indices when the model is fitted with an
antagonistic prior (a prior of same shape located on the opposite of the
effect).
}
\examples{
\dontshow{if (require("rstanarm")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
\donttest{
library(bayestestR)

# rstanarm models
# -----------------------------------------------
model <- rstanarm::stan_glm(mpg ~ wt, data = mtcars)
sensitivity_to_prior(model)

model <- rstanarm::stan_glm(mpg ~ wt + cyl, data = mtcars)
sensitivity_to_prior(model, index = c("Median", "MAP"))
}
\dontshow{\}) # examplesIf}
}
\seealso{
DescTools
}
back to top