Skip to content

Commit

Permalink
typo, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 17, 2024
1 parent 35b5e19 commit 50735e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/check_overdispersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' data. Dispersion ratios larger than one indicate overdispersion, thus a
#' negative binomial model or similar might fit better to the data. Dispersion
#' ratios much smaller than one indicate underdispersion. A p-value < .05
#' indicates either overdispersion or underdisperion (the first being more common).
#' indicates either overdispersion or underdispersion (the first being more common).
#'
#' @section Overdispersion in Poisson Models:
#' For Poisson models, the overdispersion test is based on the code from
Expand Down
2 changes: 1 addition & 1 deletion man/check_overdispersion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions tests/testthat/test-check_overdispersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_that("check_overdispersion, glmmTMB-poisson", {
""
)
)
expect_message(out, "Overdispersion detected")
expect_message(capture.output(print(out)), "Overdispersion detected")

set.seed(123)
out <- check_overdispersion(simulate_residuals(m1))
Expand All @@ -47,6 +47,7 @@ test_that("check_overdispersion, glmmTMB-poisson", {
)
})


test_that("check_overdispersion, glmmTMB-poisson mixed", {
skip_if_not_installed("glmmTMB")
skip_if_not(getRversion() >= "4.0.0")
Expand Down Expand Up @@ -170,7 +171,7 @@ test_that("check_overdispersion, MASS::negbin", {
""
)
)
expect_message(out, "Underdispersion detected")
expect_message(capture.output(print(out)), "Underdispersion detected")

# check that plot works
skip_if_not_installed("see")
Expand All @@ -193,7 +194,7 @@ test_that("check_overdispersion, genpois", {
check_overdispersion(model),
structure(
list(
dispersion_ratio = 1.02883236131678,
dispersion_ratio = 0.971975646955856,
p_value = 0.88
),
class = c("check_overdisp", "see_check_overdisp")
Expand Down

0 comments on commit 50735e3

Please sign in to comment.