Skip to content

Commit

Permalink
detect panelr as mixed model
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 24, 2024
1 parent 70f7e04 commit 86d71c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,8 @@ S3method(is_converged,merMod)
S3method(is_mixed_model,afex_aov)
S3method(is_mixed_model,default)
S3method(is_mixed_model,marginaleffects)
S3method(is_mixed_model,wbgee)
S3method(is_mixed_model,wbm)
S3method(is_nullmodel,afex_aov)
S3method(is_nullmodel,default)
S3method(link_function,BBmm)
Expand Down
8 changes: 8 additions & 0 deletions R/is_mixed_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ is_mixed_model.afex_aov <- function(x) {
is_mixed_model.marginaleffects <- function(x) {
is_mixed_model(attributes(x)$model)
}

#' @export
is_mixed_model.wbm <- function(x) {
TRUE
}

#' @export
is_mixed_model.wbgee <- is_mixed_model.wbm
2 changes: 1 addition & 1 deletion tests/testthat/test-get_variance.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ v6 <- suppressWarnings(get_variance(fm6))
test_that("error for non-mixed", {
data(mtcars)
expect_error(
get_vaiance(lm(mpg ~ gear, data = mtcars)),
get_variance(lm(mpg ~ gear, data = mtcars)),
regex = "This function only works for mixed models"
)
})
Expand Down

0 comments on commit 86d71c8

Please sign in to comment.