Description Usage Arguments Details Value Slots
View source: R/Mfx_functions.R
calculate marginal effects of features on predicted outcomes from an arbitrary prediction model. Also calculates the necessary components to construct individual conditional expectation (ICE) curves.
1 2 |
object |
a model object |
X |
an object of class |
pred_fun |
a function that accepts two arguments corresponding to
|
predictors |
a character vector of column names of |
max_pts |
an integer value or |
min_pts |
a positive integer. Predictorswith fewer than |
dydx_mean |
logical indicating whether to calculate the marginal effect
based on the mean of the derivative of ICE curves. If |
... |
arguments to be passed on to |
details coming soon
Returns a list of class Mfx or Mfx_list depending on
whether the predictors argument is of length 1 or greater. If length 1,
then the result is of class Mfx. If greater than 1, the result is of
class Mfx_list, each element of which is of class Mfx. An object
of class Mfx has the following slots:
mfxthe calculated marginal effect
sethe standard error of the calculated marginal effect
confa 95
\itemdya vector of changes in the predicted value
dxa vector of changes in the predictor (set by max_pts)
xthe predictor vector set by max_pts
yh0inital prediction corresponding to the first value of x
true_valuesdata.frame with values for dx, dy,
and predictions for the actual data points.
varnamethe name of the predictor for which a marginal effect has been
calculated
# examples coming soon
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.