This function performs repeated simulations for ANOVA to determine minimum sample sizes for given power and effect sizes, as well as calculating Type I error rates. It is designed to replicate and extend the results for Table 1 Cell 1 in Vanbrabant et al. (2015).
replext_t1_c1(
S = 20000,
k = 3,
fs = c(0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4),
n_start = 6,
constrs = c(0, 1, 2),
alpha = 0.05,
pow = 0.8,
nmax = 1000
)A data frame containing the calculated Type I error rates and the minimum sample sizes required for each combination of effect size and constraint type.
The number of datasets to generate for each simulation, default is 20000.
The number of groups in the ANOVA design.
A vector of effect sizes to consider in the simulations.
The starting sample size for the simulations.
A vector of constraint types to be used in the simulations.
The significance level used in hypothesis testing, default is 0.05.
The desired power for the statistical test, default is 0.80.
The maximum sample size to consider in the simulations.
The function uses a nested approach, first determining minimum sample sizes for various combinations of effect size and constraints, and then calculating Type I error rates. It leverages the 'pj_pow' function for power calculation and integrates internal function 'find_min_sample_size' for determining the smallest sample size achieving the desired power.
Vanbrabant, Leonard; Van De Schoot, Rens; Rosseel, Yves (2015). Constrained statistical inference: sample-size tables for ANOVA and regression. Frontiers in Psychology, 5. DOI:10.3389/fpsyg.2014.01565. URL: https://www.frontiersin.org/articles/10.3389/fpsyg.2014.01565
replext_t1_c1(S=5, fs = c(0.40), constrs = c(2))
Run the code above in your browser using DataLab