Get marginal effects and standard errors (internal function)
get_dydx_and_se(model, ...)# S3 method for default
get_dydx_and_se(
model,
variables,
fitfram = insight::get_data(model),
vcov = stats::vcov(model),
group_name = NULL,
type = "response",
numDeriv_method = "simple",
...
)
Model object
Additional arguments are pushed forward to predict()
.
Variables to consider (character vector). NULL
calculates marginal effects for all terms in the model object.
A data.frame over which to compute marginal effects.
Matrix or boolean
FALSE: does not compute unit-level standard errors.
TRUE: computes unit-level standard errors using the default vcov(model)
variance-covariance matrix.
Named square matrix: computes standard errors with a user-supplied variance-covariance matrix. This matrix must be square and have dimensions equal to the number of coefficients in get_coef(model)
.
String to identify the "group" or "level" of the terms to estimate. Groups are often used in models like multinomial logit where each level of the response variable is associated to its own set of coefficients.
Type(s) of prediction as string or vector This can differ based on the model type, but will typically be a string such as: "response", "link", "probs", or "zero".
A string to identify the variable whose marginal effect to compute.
A data.frame with term names, group names, marginal effects, and standard errors.