Determine sample size with Non-inferiority Bayes factor method
Source:R/ssp_infer_bf.R
ssp_infer_bf.Rd
A Bayesian statistical testing approach aimed at establishing non-inferiority of one condition compared to the other.
Usage
ssp_infer_bf(
tpr,
ni_margin,
delta,
thresh = 10,
tol = 1e-04,
granularity = 300,
prior_location = 0,
prior_scale = 1/sqrt(2),
max_n = 10001
)
infer_bf(
n1,
ni_margin,
delta,
thresh,
tol,
granularity,
prior_location,
prior_scale
)
Arguments
- tpr
Numeric. The desired long-run probability of obtaining a Bayes factor at least as high as the Threshold, given Delta.
- ni_margin
Numeric. A non-negative number representing the non-inferiority margin.
- delta
Numeric. The expected population effect size.
- thresh
Integer. Critical threshold for the Bayes factor.
- tol
Numeric. Relative accuracy requested.
- granularity
Numeric. Relative precision of the tpr estimates, higher values mean more precision.
- prior_location
Numeric. Location of the Cauchy prior distribution.
- prior_scale
Numeric. Scale of the Cauchy prior distribution.
- max_n
Integer. The maximum number of participants per group (both groups are assumed to have equal sample size).