The present method provides an expected sample size such that compelling evidence in the form of a Bayes factor can be collected for a given effect size with a certain long-run probability when allowing for sequential testing.

ssp_bfda(
  tpr = 0.8,
  delta,
  thresh = 10,
  n_rep = 1000,
  prior_scale = 1/sqrt(2),
  max_n = 1500
)

Arguments

tpr

Numeric. The long-run probability of obtaining a Bayes factor at least as high as the critical threshold favoring superiority, given Delta.

delta

Numeric. The expected population effect size.

thresh

Integer. The Bayes factor threshold for inference.

n_rep

Integer. The number of simulations.

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 four named numeric vectors. The first `tpr` is the range of TPRs that were provided as a parameter. The second `n1` is the range of determined sample sizes for the given design. The third `h0` is the frequency of Bayes factor providing evidence with the given threshold for the null hypothesis. The fourth `ha` is the same as `h0` but for the alternative hypothesis.

Examples

if (FALSE) { SampleSizePlanner::ssp_bfda(tpr = 0.8, delta = 0.5, thresh = 10, n_rep = 1000) }