create_priorsense_data.brmsfit: Prior sensitivity: Create priorsense data

View source: R/priorsense.R

create_priorsense_data.brmsfitR Documentation

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

Arguments

x

A brmsfit object.

...

Currently unused.

Value

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

Examples

## Not run: 
# 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")

## End(Not run)


brms documentation built on Sept. 23, 2024, 5:08 p.m.