# Specify the model
mod <-
"
m ~ x
y ~ m + x
"
# Specify the population values
mod_es <-
"
y ~ m: l
m ~ x: m
y ~ x: n
"
# Simulate the data
sim_only <- power4test(nrep = 2,
model = mod,
pop_es = mod_es,
n = 100,
do_the_test = FALSE,
iseed = 1234)
# Do the tests in each replication
test_out <- power4test(object = sim_only,
test_fun = test_parameters)
print(test_out,
test_long = TRUE)
# Do the tests in each replication: Standardized solution
# Delta method SEs will be used to do the tests
test_out <- power4test(object = sim_only,
test_fun = test_parameters,
test_args = list(standardized = TRUE))
print(test_out,
test_long = TRUE)
# Do the tests in each replication: Parameters with the selected operator
test_out <- power4test(object = sim_only,
test_fun = test_parameters,
test_args = list(op = "~"))
print(test_out,
test_long = TRUE)
# Finding valid parameter names
find_par_names(sim_only)
Run the code above in your browser using DataLab