Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion R/test_likelihoodratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ print.test_likelihoodratio <- function(x, digits = 2, ...) {
if ("LogLik" %in% names(x)) {
best <- which.max(x$LogLik)
footer <- c(sprintf("\nModel '%s' seems to have the best model fit.\n", x$Model[best]), "yellow")
} else if ("Dev" %in% names(x)) {
best <- which.min(x$Dev)
footer <- c(sprintf("\nModel '%s' seems to have the best model fit.\n", x$Name[best]), "yellow")
} else {
footer <- NULL
}
Expand Down Expand Up @@ -118,10 +121,12 @@ test_likelihoodratio.ListNestedRegressions <- function(objects, estimator = "ML"
} else {
# lmtest::lrtest()
lls <- sapply(objects, insight::get_loglikelihood, REML = REML, check_response = TRUE)
chi2 <- abs(c(NA, -2 * diff(lls)))
devs <- -2 * lls
chi2 <- abs(c(NA, diff(devs)))
p <- stats::pchisq(chi2, abs(dfs_diff), lower.tail = FALSE)

out <- data.frame(
Dev = devs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call it Deviance no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

df = dfs,
df_diff = dfs_diff,
Chi2 = chi2,
Expand Down
275 changes: 0 additions & 275 deletions tests/testthat/_snaps/check_dag.md

This file was deleted.

22 changes: 0 additions & 22 deletions tests/testthat/_snaps/mclogit.md

This file was deleted.

7 changes: 0 additions & 7 deletions tests/testthat/_snaps/model_performance.rma.md

This file was deleted.

12 changes: 0 additions & 12 deletions tests/testthat/_snaps/nestedLogit.md

This file was deleted.

Loading