R/methods_rms.R

Defines functions get_predict.rms get_vcov.orm

Documented in get_predict.rms get_vcov.orm

#' @rdname get_vcov
#' @export
get_vcov.orm <- function(model,
                         vcov = NULL,
                         ...) {
    if (!is.null(vcov) && !isTRUE(checkmate::check_flag(vcov))) {
        msg <- "The `vcov` argument is not supported for models of this class."
        insight::format_error(msg)
    }
    out <- stats::vcov(model, intercepts = "all")
    return(out)
}


#' @rdname get_predict
#' @export
get_predict.rms <- function(model, newdata = insight::get_data(model), type = NULL, ...) {
    if (is.null(type)) {
        type <- sanitize_type(model, type, calling_function = "predictions")
    }
    # {rms} predict methods break on additional arguments
    get_predict.default(model, newdata = newdata, type = type)
}

#' @rdname get_predict
#' @export
get_predict.orm <- get_predict.rms


#' @rdname get_predict
#' @export
get_predict.lrm <- get_predict.rms


#' @rdname get_predict
#' @export
get_predict.ols <- get_predict.rms

Try the marginaleffects package in your browser

Any scripts or data that you put into this service are public.

marginaleffects documentation built on Oct. 20, 2023, 1:07 a.m.