Calculate average marginal effects from a fitted model object.

smargins(model, ..., n = 1000)

Arguments

model

A fitted model object.

...

Further arguments passed to or from other methods.

n

Number of simulations to run.

at

A named list of values to set predictor variables to.

Value

A data.frame containing predictor variables values and expected values of the dependant variable.

Examples

library(smargins) lm.out <- lm(Fertility ~ Education, data = swiss) smargins(lm.out, at = list(Education = quantile(swiss$Education, c(.25, .50, .75))))
#> Error in sort.list(y): 'x' must be atomic for 'sort.list' #> Have you called 'sort' on a list?