R/methods_ivreg.R

Defines functions get_autodiff_args.ivreg

#' @keywords internal
#' @export
get_autodiff_args.ivreg <- function(model, mfx) {
    # no inheritance! Important to avoid breaking other models
    if (!class(model)[1] == "ivreg") {
        return(NULL)
    }

    if (!is.null(model$offset)) {
        autodiff_warning("models with offsets")
        return(NULL)
    }

    # If all checks pass, return supported arguments
    out <- list(model_type = "linear")
    return(out)
}



#' @keywords internal
#' @export
get_autodiff_args.ivreg <- get_autodiff_args.lm

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.