# Specify the population model
mod <-
"m ~ x
y ~ m + x"
# Specify the effect sizes (population parameter values)
es <-
"
y ~ m: m
m ~ x: m
y ~ x: n
"
# Generate several simulated datasets
data_all <- sim_data(nrep = 2,
model = mod,
pop_es = es,
n = 50,
iseed = 1234)
# Fit the population model to each datasets
fit_all <- fit_model(data_all)
# Generate bootstrap estimates for each replication
boot_all <- gen_boot(fit_all,
R = 10,
iseed = 4567)
boot_all
Run the code above in your browser using DataLab