Determine sample size with Bayesian Anova method
Source:R/ssp_anova_bf.R
, R/ssp_power_traditional_anova.R
ssp_anova_bf.Rd
The present method provides an expected sample size such that compelling evidence in the form of a Bayes factor can be collected given the group means.
Usage
ssp_anova_bf(
effect,
mu,
tpr,
thresh,
prior_scale,
iter,
max_n = 10001,
max_bf = 1e+08,
sigma = 1,
seed = NULL
)
twoway_ANOVA_bf_pwr(
effect = effect,
iter = iter,
n = n1,
mu = mu,
sigma = sigma,
thresh = thresh,
max_bf = max_bf,
prior_scale = prior_scale,
seed = NULL
)
twowayANOVApwr(effect, iter, n1, mu, sigma, alpha, seed)
Arguments
- effect
Character. The effect of interest (main effect A, main effect B, interaction effect).
- mu
Numeric. The mean of the DV for each group.
- tpr
Numeric. The long-run probability of obtaining a Bayes factor at least as high as the critical threshold favoring superiority, given mu.
- thresh
Integer. The Bayes factor threshold for inference.
- prior_scale
Numeric. Scale of the Cauchy prior distribution.
- iter
Integer. The number of iterations.
- max_n
Integer. The maximum number of participants per group (all groups are assumed to have equal sample size).
- max_bf
Numeric. The maximum Bayes Factor value to reduce computation time. If all Bayes Factors in the first 10 iterations exceeded the max_bf, we set the TPR equal to 1 and proceeded with the next sample size.
- sigma
Numeric. The standard deviation of the DV for the groups.
- seed
Numeric. The seed for reproducibility.
- n
Numeric. The sample size per group during the tpr optimization process.
- n1
Numeric. The sample size per group during the tpr optimization process.