Temporary smargins variant

smargins_v2(model, vars, xvalues = NULL, 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) })

Arguments

model

A fitted model object.

vars

Character vector naming variables

xvalues

Named list of values.

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.

Value

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