R/methods_bife.R

Defines functions get_predict.bife

Documented in get_predict.bife

#' @include get_predict.R
#' @rdname get_predict
#' @keywords internal
#' @export
get_predict.bife <- function(
    model,
    newdata = insight::get_data(model),
    type = "response",
    ...) {
    pred <- stats::predict(model, X_new = newdata, type = type, ...)

    sanity_predict_vector(
        pred = pred,
        model = model,
        newdata = newdata,
        type = type
    )
    sanity_predict_numeric(
        pred = pred,
        model = model,
        newdata = newdata,
        type = type
    )

    out <- data.table(estimate = pred)
    out <- add_rowid(out, newdata)

    return(out)
}

Try the marginaleffects package in your browser

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

marginaleffects documentation built on Sept. 13, 2025, 5:07 p.m.