Calculate average marginal effects from a fitted model object.
# S3 method for default smargins(model, ..., n = 5000, coef.fun = coef, sim.fun = I, linkinv.fun = family(model)$linkinv, vcov.fun = vcov, model.frame.fun = model.frame, model.matrix.fun = function(x, data) { model.matrix(formula(x), data = data) })
| model | A fitted model object. |
|---|---|
| ... | Named values to set predictor variables to. |
| n | Number of simulations to run. |
| coef.fun | Function to use for computing coefficients. |
| sim.fun | Function to use for adjusting simulations. |
| linkinv.fun | Function to use for cmputing the inverse link. |
| vcov.fun | Function to use for computing the variance-covariance matrix. |
| model.frame.fun | Function to use for extracting the model.frame. |
| model.matrix.fun | Function to use for extracting the model.matrix. |
A data.frame containing predictor variables values and expected values of the dependant variable.