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:
mfx
the calculated marginal effect
se
the standard error of the calculated marginal effect
conf
a 95
\itemdy
a vector of changes in the predicted value
dx
a vector of changes in the predictor (set by max_pts
)
x
the predictor vector set by max_pts
yh0
inital prediction corresponding to the first value of x
true_values
data.frame
with values for dx
, dy
,
and predictions for the actual data points.
varname
the 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.