Refit a marginaleffects object with new data
Usage
refit(object, ...)
# S3 method for class 'marginaleffects'
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for class 'predictions'
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for class 'comparisons'
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for class 'slopes'
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)
# S3 method for class 'hypotheses'
refit(object, data = NULL, newdata = NULL, vcov = NULL, ...)Arguments
- object
A marginaleffects object (predictions, comparisons, or slopes)
- ...
Additional arguments passed to methods
- data
Optional data frame to refit the underlying model
- newdata
Optional data frame to re-evaluate the marginaleffects call
- vcov
Optional logical or variance-covariance matrix specification to pass to the marginaleffects call