tests/testthat/test-multiple_imp.R

data("curry")
df <- curry[c(1:5, 50:55), c("d", "vi", "sex", "age", "donorcode")]
test_that("brma runs fine", {
  expect_error(suppressWarnings({res <- brma(d~., data = df, iter = 10)}), NA)
})

if(requireNamespace("mice", quietly = TRUE)){
  library(mice)
  nhanes$vi <- runif(nrow(nhanes))
  imp <- mice(nhanes, m = 5, print = FALSE)

  test_that("brma runs fine with mice", {
    expect_error(suppressWarnings({tmp <- brma(bmi~., vi ="vi", data = imp, iter = 10)}), NA)
  })
}

Try the pema package in your browser

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

pema documentation built on April 4, 2025, 1:36 a.m.