Learn R Programming

brms (version 2.22.0)

create_priorsense_data.brmsfit: Prior sensitivity: Create priorsense data

Description

The create_priorsense_data.brmsfit method can be used to create the data structure needed by the priorsense package for performing power-scaling sensitivity analysis. This method is called automatically when performing powerscaling via powerscale or other related functions, so you will rarely need to call it manually yourself.

Usage

create_priorsense_data.brmsfit(x, ...)

Value

A priorsense_data object to be used in conjunction with the priorsense package.

Arguments

x

A brmsfit object.

...

Currently unused.

Examples

Run this code
if (FALSE) {
# fit a model with non-uniform priors
fit <- brm(rating ~ treat + period + carry,
           data = inhaler, family = sratio(),
           prior = set_prior("normal(0, 0.5)"))
summary(fit)

# The following code requires the 'priorsense' package to be installed:
library(priorsense)

# perform power-scaling of the prior
powerscale(fit, alpha = 1.5, component = "prior")

# perform power-scaling sensitivity checks
powerscale_sensitivity(fit)

# create power-scaling sensitivity plots (for one variable)
powerscale_plot_dens(fit, variable = "b_treat")
}

Run the code above in your browser using DataLab