Skip to content

Commit

Permalink
#509 (test_wald calls LRT for binomial models)
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 31, 2022
1 parent b67a0c4 commit 1dc913c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion R/test_wald.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ test_wald.default <- function(...) {

#' @export
test_wald.ListNestedRegressions <- function(objects, ...) {
out <- .test_wald(objects, test = "F")
# for binomial models, only chisq-test
if (all(attributes(objects)$is_binomial)) {
insight::format_warning(
"Using Wald's F-Test is inappropriate for models with `binomial` family.",
"Running Likelihood Ratio Test (LRT) now."
)
return(test_likelihoodratio(objects))
} else {
out <- .test_wald(objects, test = "F")
}

attr(out, "is_nested") <- TRUE
class(out) <- c("test_performance", class(out))
Expand Down

0 comments on commit 1dc913c

Please sign in to comment.