Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 23, 2024
1 parent a2ddd83 commit 85fd8d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/get_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ get_df.nestedLogit <- function(x, type = NULL, component = "all", verbose = TRUE
type <- "wald"
}
if (tolower(type) == "residual") {
cf <- as.data.frame(stats::coef(model))
dof <- rep(vapply(model$models, stats::df.residual, numeric(1)), each = nrow(cf))
cf <- as.data.frame(stats::coef(x))
dof <- rep(vapply(x$models, stats::df.residual, numeric(1)), each = nrow(cf))
if (!is.null(component) && !identical(component, "all")) {
comp <- intersect(names(dof), component)
if (length(comp)) {
Expand All @@ -380,7 +380,7 @@ get_df.nestedLogit <- function(x, type = NULL, component = "all", verbose = TRUE
if (verbose) {
format_alert(paste0(
"No matching model found. Possible values for `component` are ",
toString(paste0("'", names(model$models), "'")),
toString(paste0("'", names(x$models), "'")),
"."
))
}
Expand Down

0 comments on commit 85fd8d7

Please sign in to comment.