A Bayesian statistical testing approach aimed at establishing equivalence between two groups.

ssp_eq_bf(
  tpr,
  eq_band,
  delta,
  thresh = 10,
  tol = 1e-04,
  granularity = 300,
  prior_location = 0,
  prior_scale = 1/sqrt(2),
  max_n = 10001
)

eq_bf(
  n1,
  eq_band,
  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.

eq_band

Numeric. The chosen width of the equivalence region.

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

Value

The function returns a list of two named numeric vectors. The first `n1` the determined sample size per group. The third `tpr_out` is the TPR corresponding to the determined sample sizes.

Examples

if (FALSE) { SampleSizePlanner::ssp_eq_bf(tpr = 0.8, delta = 0, eq_band = 0.2, thresh = 10) }