tests/testthat/test-glm.nb.R

skip_if_not_installed("MASS")
data(quine, package = "MASS")
set.seed(123)
m1 <- MASS::glm.nb(Days ~ Sex / (Age + Eth * Lrn), data = quine)

test_that("get_df", {
  expect_equal(
    get_df(m1, type = "residual"),
    df.residual(m1),
    ignore_attr = TRUE
  )
  expect_equal(
    get_df(m1, type = "normal"),
    Inf,
    ignore_attr = TRUE
  )
  expect_equal(
    get_df(m1, type = "wald"),
    Inf,
    ignore_attr = TRUE
  )
})

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.