R/isFitLogit.R

Defines functions isFitLogit

Documented in isFitLogit

#' The \emph{isFitLogit} is a simple check if object inherits either "lrm" 
#' class or inherits the  "glm" class together with a "logit" link 
#' function indicating that it is a logistic function.
#'
#' @rdname isFitFn
#' 
#' @example inst/examples/isFitLogit_example.R
#' 
#' @export
isFitLogit <- function(fit){
  if ("lrm" %in% class(fit)) {
    return(TRUE)
  }
  
  if (inherits(fit, "glm") &&
    family(fit)$family == "binomial") {
    return(TRUE)
  }
  
  return(FALSE)  
}
gforge/Greg documentation built on Feb. 3, 2024, 5:37 a.m.