Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 2, 2025
1 parent 8feba9c commit b947b34
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/testthat/test-estimate_grouplevel.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,22 @@ test_that("estimate_grouplevel - lme4", {
all(reshaped$Subject == ref$Subject)
all(reshaped$grp == ref$grp)
all(reshaped$subgrp == ref$subgrp)
})

test_that("estimate_grouplevel - glmmTMB", {
skip_on_cran()
skip_if_not_installed("glmmTMB")
data <- iris
data$Group <- as.factor(rep(c("G1", "G2", "G3"), each = 50))

m1 <- glmmTMB::glmmTMB(
Sepal.Width ~ Petal.Width + (Petal.Width | Group),
data = data
)

out <- estimate_grouplevel(m1)
expect_identical(dim(out), c(6L, 8L))
expect_named(out, c("Group", "Level", "Parameter", "Coefficient", "SE", "CI", "CI_low", "CI_high"))

# # Bayesian
# data <- iris
Expand Down

0 comments on commit b947b34

Please sign in to comment.