tests/testthat/test-ptable_pop_np.R

library(testthat)
suppressMessages(library(lavaan))

test_that("ptable_pop: Nonpositive definite", {

# Simple mediation model

mod <-
"
m ~ x
y ~ m + x
"

pop_es <- c("m ~ x" = ".90",
            "y ~ m" = ".90",
            "y ~ x" = ".90")

expect_error(ptable_pop(model = mod,
                        pop_es = pop_es))

})

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.