computeAME: Compute Average Marginal Effects

Description Usage Arguments

Description

Computes the average marginal effects for specified features.

Usage

1
2
computeAME(model, data, features, at = NULL, predict.fun = NULL,
  cl = NULL, ...)

Arguments

model

[WrappedModel | any]
A model object. Can be also an object of class WrappedModel.

data

[logical(1)]
The data set that was used to fit the model.

features

[logical(1)]
The features for which the average marginal effects should be computed.

at

[list]
(optional) A named list of vectors where the values specify at which points the marginal effects are calculated (i.e. the values are held constant).

predict.fun

[function(1)]
The function that should be used to generate predictions from model. The specified prediction function is subject to subsequent numeric differentiation and thus needs to be carefully chosen in order to receive the correct results. This function must have two arguments, object and newdata. The default is the predict method for model. If model is of class WrappedModel, the default tries to use getPredictionProbabilities or getPredictionResponse depending on whether model is a classification or regression problem.

cl

('character(1)')
Names of classes. Default is either all classes for multi-class / multilabel problems or the positive class for binary classification.

...

Further options passed down to the grad function.


compstat-lmu/ame documentation built on May 13, 2019, 12:53 p.m.