tests/testthat/test-mhurdle.R

skip_if_not_installed("mhurdle")

data("Interview", package = "mhurdle")
m1 <- mhurdle::mhurdle(shows ~ 0 | linc + smsa + age + educ + size, data = Interview, h2 = TRUE, dist = "n", method = "bhhh")
m2 <- mhurdle::mhurdle(shows ~ educ + size | linc | smsa + age,
  data = Interview,
  h2 = FALSE, method = "bhhh", corr = TRUE, finalHessian = TRUE
)

test_that("get_data", {
  d1 <- get_data(m1)
  d2 <- get_data(m2)
  expect_s3_class(d1, "data.frame")
  expect_s3_class(d2, "data.frame")
  expect_equal(dim(d1), c(1000, 6))
  expect_equal(dim(d2), c(1000, 6))
})

Try the insight package in your browser

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

insight documentation built on Nov. 26, 2023, 5:08 p.m.