Get all marginal effects of variables in the fit

marginal_effects(fit, type = "mea", variable = "all", data = NA, trim = 0.05)

Arguments

fit

model fitted by qs()

type

one of "ame" (average marginal effects) or "mea" (marginal effects at the average)

variable

which variable to calculate marginal effects on

data

optional data.frame that specifies level of data to calculate marginal effects

trim

What to trim the variable of interest at, 0 < trim < 0.5

Details

The trim defaults to using the 95th percentile instead of the max because there may be large outliers. You can over-ride by setting trim to 0, which will use the min and max. By default, marginal effects will calculate marginal effects for all variables.