Skip to content

Commit

Permalink
fix add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 22, 2023
1 parent cde432b commit a914fe5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions tests/testthat/test-glmmTMB.R
Original file line number Diff line number Diff line change
Expand Up @@ -952,3 +952,21 @@ test_that("get_predicted", {
expect_warning(get_predicted(m1, predict = "prediction"))
expect_warning(get_predicted(m1, predict = "classification"))
})


test_that("model_info, ordered beta", {
skip_if_not_installed("glmmTMB")
skip_if_not_installed("datawizard")
skip_if_not_installed("lme4")
skip_if_not(packageVersion("glmmTMB") >= "1.1.5")
data(sleepstudy, package = "lme4")
sleepstudy$y <- datawizard::normalize(sleepstudy$Reaction)
m <- glmmTMB::glmmTMB(
y ~ Days + (Days | Subject),
data = sleepstudy,
family = ordbeta()
)
out <- model_info(m)
expect_true(out$is_orderedbeta)
expect_identicl(out$family, "ordbeta")
})
6 changes: 3 additions & 3 deletions tests/testthat/test-rstanarm.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ test_that("model_info-stanreg-glm", {
list(
is_binomial = TRUE, is_bernoulli = FALSE, is_count = FALSE,
is_poisson = FALSE, is_negbin = FALSE, is_beta = FALSE, is_betabinomial = FALSE,
is_dirichlet = FALSE, is_exponential = FALSE, is_logit = TRUE,
is_orderedbeta = FALSE, is_dirichlet = FALSE, is_exponential = FALSE, is_logit = TRUE,
is_probit = FALSE, is_censored = FALSE, is_truncated = FALSE,
is_survival = FALSE, is_linear = FALSE, is_tweedie = FALSE,
is_zeroinf = FALSE, is_zero_inflated = FALSE, is_dispersion = FALSE,
Expand All @@ -183,7 +183,7 @@ test_that("model_info-stanreg-glm", {
list(
is_binomial = FALSE, is_bernoulli = FALSE, is_count = FALSE,
is_poisson = FALSE, is_negbin = FALSE, is_beta = FALSE, is_betabinomial = FALSE,
is_dirichlet = FALSE, is_exponential = FALSE, is_logit = FALSE,
is_orderedbeta = FALSE, is_dirichlet = FALSE, is_exponential = FALSE, is_logit = FALSE,
is_probit = FALSE, is_censored = FALSE, is_truncated = FALSE,
is_survival = FALSE, is_linear = TRUE, is_tweedie = FALSE,
is_zeroinf = FALSE, is_zero_inflated = FALSE, is_dispersion = FALSE,
Expand All @@ -205,7 +205,7 @@ test_that("model_info-stanreg-glm", {
list(
is_binomial = TRUE, is_bernoulli = TRUE, is_count = FALSE,
is_poisson = FALSE, is_negbin = FALSE, is_beta = FALSE, is_betabinomial = FALSE,
is_dirichlet = FALSE, is_exponential = FALSE, is_logit = TRUE,
is_orderedbeta = FALSE, is_dirichlet = FALSE, is_exponential = FALSE, is_logit = TRUE,
is_probit = FALSE, is_censored = FALSE, is_truncated = FALSE,
is_survival = FALSE, is_linear = FALSE, is_tweedie = FALSE,
is_zeroinf = FALSE, is_zero_inflated = FALSE, is_dispersion = FALSE,
Expand Down

0 comments on commit a914fe5

Please sign in to comment.