R/lmranks_model_selection.R

Defines functions drop1.lmranks add1.lmranks extractAIC.lmranks proj.lmranks anova.lmranks logLik.lmranks

Documented in proj.lmranks

#' @export
logLik.lmranks <- function(object, ...){
  cli::cli_abort("This method does not return correct results.")
}

#' @export
anova.lmranks <- function(object, ...){
  cli::cli_abort("This method is not implemented.")
}

#' @describeIn lmranks Projections of the data onto terms of rank-rank regression model
#' @importFrom stats proj
#' @inheritParams stats::proj
#' @export
proj.lmranks <- function(object, onedf = FALSE, ...){
  object$df.residual <- stats::nobs(object) - length(coef(object))
  out <- NextMethod()
  object$df.residual <- NA
  attr(out, "df") <- c(NA, NA, NA)
  return(out)
}

#' @export
extractAIC.lmranks <- function(fit, scale, k, ...){
  cli::cli_warn(c("NAs returned.",
                 "i" = "The notion of effective degrees of freedom for rank models is not clear."))
  c(NA, NA)
}

#' @export
add1.lmranks <- function(object, scope, ...){
  cli::cli_warn(c("NAs returned.",
                 "i" = "The notion of effective degrees of freedom for rank models is not clear."))
  NextMethod()
}

#' @export
drop1.lmranks <- function(object, scope, ...){
  cli::cli_warn(c("NAs returned.",
                 "i" = "The notion of effective degrees of freedom for rank models is not clear."))
  NextMethod()
}

# AIC, BIC
danielwilhelm/R-CS-ranks documentation built on Sept. 11, 2024, 4:18 p.m.