This function generates replext tables for linear regression, similar to those in Table 2 Cell 1 of the referenced paper. It computes minimum sample sizes for various power and effect size combinations, and calculates Type I error rates.
replext_t2_c1(
S = 20000,
p = 3,
f2s = c(0.02, 0.05, 0.08, 0.1, 0.15, 0.2, 0.25, 0.35),
n_start = 6,
constrs = c(0, 1, 2, 3),
rho = 0,
beta = 0.1,
alpha = 0.05,
pow = 0.8,
standardize = TRUE,
nmax = 1000
)A data frame containing 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 predictors in the regression model.
A vector of effect sizes to be used in the simulations.
The starting sample size for the simulations.
A vector of constraint types (number of inequality constraints) to be applied in the simulations.
The correlation coefficient between predictors, default is 0.0.
The regression coefficient for predictors, default is 0.1.
The significance level used in hypothesis testing, default is 0.05.
The desired power for the statistical test, default is 0.80.
A logical flag to indicate whether to standardize the predictors in the datasets, default is TRUE.
The maximum sample size to consider in the simulations.
The function uses a nested approach to first determine minimum sample
sizes for different combinations of effect size and constraints, and then
calculates Type I error rates. It leverages the lr_pow function for power
calculation and uses generate_datasets_reg for dataset generation.
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_t2_c1(S = 2, f2s = c(0.35), constrs = c(2))
Run the code above in your browser using DataLab