Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 3, 2023
1 parent f6e8544 commit 2d4a3fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/r2.R
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ r2.glm <- function(model, ci = NULL, verbose = TRUE, ...) {
if (info$family %in% c("gaussian", "inverse.gaussian")) {
out <- r2.default(model, ...)
} else if (info$is_logit && info$is_bernoulli) {
out <- list("R2_Tjur" = r2_tjur(model, ...))
out <- list("R2_Tjur" = r2_tjur(model, model_info = info, ...))

Check warning on line 294 in R/r2.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/r2.R,line=294,col=17,[keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names).
attr(out, "model_type") <- "Logistic"
names(out$R2_Tjur) <- "Tjur's R2"
class(out) <- c("r2_pseudo", class(out))
Expand All @@ -312,6 +312,10 @@ r2.glm <- function(model, ci = NULL, verbose = TRUE, ...) {
#' @export
r2.glmx <- r2.glm

#' @export
r2.nestedLogit <- function(model, ci = NULL, verbose = TRUE, ...) {
lapply(r2, model$models, ci = ci, verbose = verbose, ...)
}



Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-nestedLogit.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_on_os(c("mac", "linux"))
skip_if_not_installed("nestedLogit")
skip_if_not_installed("carData")

Expand Down

0 comments on commit 2d4a3fb

Please sign in to comment.