tests/testthat/test_many_indirects_do_sim_once.R

skip_on_cran()
# A long test

library(testthat)
library(manymome)
suppressMessages(library(lavaan))

dat <- data_serial

library(lavaan)
mod_med <- "
m1 ~ x
m2 ~ m1 + x
y ~ m2 + m1 + x
"
fit_med <- sem(model = mod_med,
               data = dat,
               fixed.x = TRUE)

all_paths <- all_indirect_paths(fit = fit_med,
                                x = "x",
                                y = "y")
all_paths

out_all <- many_indirect_effects(paths = all_paths,
                                 fit = fit_med,
                                 standardized_x = TRUE,
                                 standardized_y = TRUE,
                                 boot_ci = TRUE,
                                 R = 100,
                                 seed = 12345,
                                 parallel = FALSE,
                                 progress = FALSE)
out_all

Try the manymome package in your browser

Any scripts or data that you put into this service are public.

manymome documentation built on Oct. 4, 2024, 5:10 p.m.