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 Oct. 20, 2023, 1:07 a.m.