Learn R Programming

bayestestR (version 0.15.0)

sensitivity_to_prior: Sensitivity to Prior

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).

Usage

sensitivity_to_prior(model, ...)

# S3 method for stanreg sensitivity_to_prior(model, index = "Median", magnitude = 10, ...)

Arguments

model

A Bayesian model (stanreg or brmsfit).

...

Arguments passed to or from other methods.

index

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

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.

See Also

DescTools

Examples

Run this code
if (FALSE) { # require("rstanarm")
# \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"))
# }
}

Run the code above in your browser using DataLab