Refit a marginaleffects object with new data
refit(object, ...)# S3 method for marginaleffects
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for predictions
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for comparisons
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for slopes
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for hypotheses
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
A marginaleffects object
A marginaleffects object (predictions, comparisons, or slopes)
Additional arguments passed to methods
Optional data frame to refit the underlying model
Optional data frame to re-evaluate the marginaleffects call
Optional logical or variance-covariance matrix specification to pass to the marginaleffects call
If data is supplied, the underlying model is refitted using that data.
If newdata is supplied, the marginaleffects call is re-evaluated with the new data.
Both can be supplied together to refit the model and make predictions on new data.