Skip to content

Commit

Permalink
df.residual methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Dec 10, 2024
1 parent 5e43fa5 commit d6bfba0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ S3method(coef,hypotheses)
S3method(coef,marginalmeans)
S3method(coef,predictions)
S3method(coef,slopes)
S3method(df.residual,comparisons)
S3method(df.residual,predictions)
S3method(df.residual,slopes)
S3method(get_coef,afex_aov)
S3method(get_coef,betareg)
S3method(get_coef,bracl)
Expand Down
22 changes: 20 additions & 2 deletions R/methods.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @noRd
#' @export
vcov.comparisons <- function(object, ...) {
attr(object, "jacobian") %*% attr(object, "vcov") %*% t(attr(object, "jacobian"))
attr(object, "jacobian") %*% attr(object, "vcov") %*% t(attr(object, "jacobian"))
}


Expand Down Expand Up @@ -60,4 +60,22 @@ coef.predictions <- coef.comparisons

#' @export
#' @noRd
coef.hypotheses <- coef.comparisons
coef.hypotheses <- coef.comparisons


#' @export
#' @noRd
df.residual.comparisons <- function(x, ...) {
out <- tryCatch(stats::df.residual(attr(x, "model")), error = function(e) NULL)
return(out)
}


#' @export
#' @noRd
df.residual.predictions <- df.residual.comparisons


#' @export
#' @noRd
df.residual.slopes <- df.residual.comparisons
4 changes: 2 additions & 2 deletions man/posterior_draws.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d6bfba0

Please sign in to comment.