find_beta_params {adaptr} | R Documentation |
Find beta distribution parameters from thresholds
Description
Helper function to find a beta distribution with parameters corresponding
to the fewest possible patients with events/non-events and a specified event
proportion. Used in the Advanced example vignette
(vignette("Advanced-example", "adaptr")
) to derive beta
prior
distributions for use in beta-binomial conjugate models, based on a belief
that the true event probability lies within a specified percentile-based
interval (defaults to 95%
). May similarly be used by users to derive other
beta
priors.
Usage
find_beta_params(
theta = NULL,
boundary_target = NULL,
boundary = "lower",
interval_width = 0.95,
n_dec = 0,
max_n = 10000
)
Arguments
theta |
single numeric |
boundary_target |
single numeric |
boundary |
single character string, either |
interval_width |
width of the credible interval whose lower/upper
boundary should be used (see |
n_dec |
single non-negative integer; the returned parameters are rounded
to this number of decimals. Defaults to |
max_n |
single integer |
Value
A single-row data.frame
with five columns: the two shape parameters
of the beta distribution (alpha
, beta
), rounded according to n_dec
,
and the actual lower and upper boundaries of the interval and the median
(with appropriate names, e.g. p2.5
, p50
, and p97.5
for a
95%
interval), when using those rounded values.