Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 22, 2024
1 parent e66edad commit ab79c7f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/testthat/test-check_zeroinflation.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ test_that("check_zeroinflation, glmmTMB nbinom", {
skip_if_not_installed("DHARMa")
skip_on_cran()

data(Salamanders, package = "glmmTMB")
m <- glmmTMB::glmmTMB(
count ~ spp + mined + (1 | site),
family = glmmTMB::nbinom1(),
data = Salamanders
)
set.seed(1234)
dat <- DHARMa::createData(sampleSize = 1000)
fit <- suppressWarnings(glmmTMB::glmmTMB(
observedResponse ~ Environment1 + (1 | group),
data = dat,
family = glmmTMB::nbinom1()
))
expect_equal(
check_zeroinflation(fit),
check_zeroinflation(m),
structure(
list(
predicted.zeros = 424,
observed.zeros = 401L,
ratio = 1.05636907730673,
predicted.zeros = 389,
observed.zeros = 387L,
ratio = 1.00635658914729,
tolerance = 0.1,
p.value = 0.784
p.value = 0.944
),
class = "check_zi"
),
Expand Down

0 comments on commit ab79c7f

Please sign in to comment.