diff --git a/R/check_overdispersion.R b/R/check_overdispersion.R index 9e063fec5..db4873c18 100644 --- a/R/check_overdispersion.R +++ b/R/check_overdispersion.R @@ -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 diff --git a/man/check_overdispersion.Rd b/man/check_overdispersion.Rd index d1aaea175..19c957323 100644 --- a/man/check_overdispersion.Rd +++ b/man/check_overdispersion.Rd @@ -41,7 +41,7 @@ If the dispersion ratio is close to one, a Poisson model fits well to the 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}{ diff --git a/tests/testthat/test-check_overdispersion.R b/tests/testthat/test-check_overdispersion.R index beaffe562..2930322bb 100644 --- a/tests/testthat/test-check_overdispersion.R +++ b/tests/testthat/test-check_overdispersion.R @@ -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)) @@ -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") @@ -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") @@ -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")