| refit | R Documentation |
Refit a marginaleffects object with new data
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, ...)
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 |
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.
A marginaleffects object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.