This function generates a specified number of datasets for regression analysis
simulations. Each dataset is generated using the sim_reg function, based on
given parameters like sample size, number of predictors, effect size, and
correlation coefficient.
generate_datasets_reg(S = 20000, n, p, f2, rho, beta = 0.1)A list of data frames, each representing a simulated dataset for regression analysis. Each data frame contains columns for the response variable 'y' and predictors 'x1', 'x2', ..., 'xp'.
The number of datasets to generate, default is 20000.
The number of observations in each dataset.
The number of predictors in the regression model for each dataset.
The effect size for each dataset, defined as (f^2 = R^2 / (1 - R^2)).
The correlation coefficient between predictors in each dataset.
The regression coefficients for the predictors in each dataset, either as a single value or a vector of length (p).
The function uses sim_reg to simulate individual datasets, which
are then combined into a list. Each dataset is a data frame with named
columns for the response variable and predictors.
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
datasets <- generate_datasets_reg(S = 2, n = 50, p = 3, f2 = 0.10, rho = 0.5)
Run the code above in your browser using DataLab