Determine sample size with the Bayesian Interval Equivalence Method
Source:R/ssp_anova_eq.R
ssp_anova_eq.Rd
Script for pre-calculation. 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 eq band with a certain long-run probability.
Usage
ssp_anova_eq(
mu,
effect,
eq_band,
tpr,
thresh,
prior_scale,
iter,
post_iter = 1000,
sigma = 1,
prior_location = 0,
max_n = 10001,
seed = NULL
)
twoway_ANOVA_eq_pwr(
n = n1,
effect = effect,
eq_band = eq_band,
iter = iter,
post_iter = post_iter,
mu = mu,
sigma = sigma,
thresh = thresh,
prior_scale = prior_scale,
prior_location = prior_location,
seed = NULL
)
Arguments
- mu
Numeric. The unstandardized mean of the DV for each group.
- effect
Character. The effect of interest (main effect A, main effect B).
- eq_band
Numeric. The margin of the standardized equivalence region.
- tpr
Numeric. The desired long-run probability of obtaining a Bayes factor higher than Thresh, given the means.
- thresh
Numeric. The threshold of the Bayes Factor which is fixed to 10 in the ShinyApp.
- prior_scale
Numeric. The scale of the Cauchy prior which is fixed to 1 / sqrt(2) in the ShinyApp.
- iter
Numeric. The number of iterations to calculate the TPR which is fixed to 1000 in the ShinyApp.
- post_iter
Numeric. The number of iterations to estimate the posterior distribution which is fixed to 1000 in the ShinyApp.
- sigma
Numeric. The standard deviation of the DV for the groups.
- prior_location
Numeric. The scale of the Cauchy prior which is fixed to 1 / sqrt(2) in the ShinyApp.
- max_n
Numeric. The maximum group size which is fixed to 500 in the ShinyApp.
- seed
Numeric. Seed for the random calculations.
- n
Numeric. The sample size per group during the tpr optimization process.