Skip to content

Commit

Permalink
fix for rlm
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 23, 2024
1 parent a0e6ff4 commit 52847fd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ S3method(get_df,phylolm)
S3method(get_df,poissonirr)
S3method(get_df,poissonmfx)
S3method(get_df,probitmfx)
S3method(get_df,rlm)
S3method(get_df,svy2lme)
S3method(get_family,default)
S3method(get_family,list)
Expand Down
12 changes: 12 additions & 0 deletions R/get_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ get_df.svy2lme <- function(x, type = "residual", verbose = TRUE, ...) {
}


#' @export
get_df.rlm <- function(x, type = "residual", verbose = TRUE, ...) {
if (identical(type, "model")) {
.model_df(x)
} else if (identical(type, "normal")) {
Inf
} else {
.degrees_of_freedom_residual(x)
}
}


#' @export
get_df.mmrm <- function(x, type = "residual", verbose = TRUE, ...) {
if (identical(type, "model")) {
Expand Down
3 changes: 3 additions & 0 deletions R/get_df_residual.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
n - nparam
}

#' @keywords internal
.degrees_of_freedom_residual.rlm <- .degrees_of_freedom_residual.gls

#' @keywords internal
.degrees_of_freedom_residual.glimML <- function(x, verbose = TRUE, ...) {
check_if_installed("aod")
Expand Down

0 comments on commit 52847fd

Please sign in to comment.