prob_all_equi: Calculate the probability that all arms are practically...

View source: R/prob_funs.R

prob_all_equiR Documentation

Calculate the probability that all arms are practically equivalent

Description

Used internally. This function takes a matrix as calculated by the get_draws_binom(), get_draws_norm() or a corresponding custom function (specified using the fun_draws argument in setup_trial(); see get_draws_generic()), and an equivalence difference, and calculates the probability of all arms being equivalent (absolute differences between highest and lowest value in the same set of posterior draws being less than the difference considered practically equivalent).

Usage

prob_all_equi(m, equivalence_diff = NULL)

Arguments

m

a matrix with one column per trial arm (named as the arms) and one row for each draw from the posterior distributions.

equivalence_diff

single numeric value (⁠> 0⁠) or NULL (default, corresponding to no equivalence assessment). If a numeric value is specified, estimated absolute differences smaller than this threshold will be considered equivalent. For designs with a common control arm, the differences between each non-control arm and the control arm is used, and for trials without a common control arm, the difference between the highest and lowest estimated outcome rates are used and the trial is only stopped for equivalence if all remaining arms are equivalent.

Value

A single numeric value corresponding to the probability of all arms being practically equivalent.


adaptr documentation built on May 29, 2024, 7:48 a.m.