tests/testthat/test-fix_par_es_ind_negative.R

# Test

test_that("fix_par_es: indirect, negative", {

model <-
"
m1 ~ x1
m2 ~ m1
m3 ~ x2
y ~ m2 + m3 + x1
y2 ~ m3 + x2
"

model_es <- c("m1 ~ x1" = "-m",
              "m2 ~ m1" = "s",
              "y ~ m3" = "l",
              ".beta." = "m",
              ".cov." = "-s",
              ".ind.(x1-> m1->m2->y)" = "mi",
              ".ind.(y~m3~ x2)" = "-li")

expect_error(fix_par_es(model_es, model))

model_es <- c("m1 ~ x1" = "-m",
              "m2 ~ m1" = "s",
              "y ~ m3" = "l",
              ".beta." = "m",
              ".cov." = "-s",
              ".ind.(x1-> m1->m2->y)" = "mi",
              ".ind.(y~m3~ x2)" = "-.30")

expect_error(fix_par_es(model_es, model))

})

Try the power4mome package in your browser

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

power4mome documentation built on Sept. 9, 2025, 5:35 p.m.