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.frame(
        rowid = seq_len(nrow(newdata)),
        estimate = pred
    )

    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 June 8, 2025, 12:44 p.m.