sim_multilevel.Rd
simulate tibble of two-level data with outcome, id_vector, and categorical/continuous covariates with varied magnitudes of effect. Nuisance predictors (orthogonal to outcome) also included.
sim_multilevel(
j = 116,
intercept_1 = 0,
residual_var_sd_1 = 0.4,
random_int_mean_2 = 0,
residual_var_sd_2 = 0.1,
start_seed = 713,
num_in_groups = rpois(n = j, lambda = 15)
)
integer—number level 2 units
double—intercept at level 1
double—standard deviation of residuals at level 1
double—mean of random intercept at level 2
double—standard deviation of random intercept at level 2,
integer—starting seed,
numeric vector—number of observations per group length of argument j
tibble
J <- 116
dat <-
sim_multilevel(
j = J,
intercept_1 = 0,
residual_var_sd_1 = 0.7,
random_int_mean_2 = 0,
residual_var_sd_2 = 0.3,
start_seed = 713,
num_in_groups = rpois(n = J, lambda = 15)
)