tests/testthat/test_get_vcov.R

skip_on_cran()
skip_if_not_installed("semTools")
# Require semTools
library(testthat)
library(manymome)
suppressMessages(library(lavaan))
suppressMessages(library(semTools))

fn <- system.file("extdata", "mi_test_data.RData", package = "manymome")
load(fn)

test_that("get_vcov", {
    tmp1 <- get_vcov(fit1_lav)
    tmp2 <- get_vcov(fit1_mi)
    expect_identical(rownames(tmp1), rownames(tmp2))
    expect_identical(colnames(tmp1), colnames(tmp2))
    expect_identical(tmp1, lavInspect(fit1_lav, "vcov"))
    expect_identical(tmp2, vcov(fit1_mi))
  })

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.