Description Usage Arguments Details Value Author(s)
Calculates the cross-derivative required to evaluate interactions in logistic/probit regression models.
1 2 3 4 5 6 7 8 | secondDiff(
obj,
vars,
data,
method = c("AME", "MER"),
vals = NULL,
typical = NULL
)
|
obj |
An object of class |
vars |
A vector of two variables to be used in calculating the derivative. |
data |
A data frame. |
method |
Indicate whether you want to use average marginal effects (AME) or marginal effects at representative values (MER). |
vals |
A named list of length 2 where each element gives the minimum and maximum values used in the calculation. |
typical |
A named vector of values at which to hold variables constant. |
The function calculates the second difference as (Pr(Y=1|x1=max, x2=max) - Pr(Y=1|x1=min, x2=max)) - (Pr(Y=1|x1=max, x2=min) - Pr(Y=1|x1=min, x2=min)). The function uses a parametric bootstrap to calculate the sampling distribution of the second difference.
A list with two elements:
ave |
The average second difference in each iteration of the bootstrap. |
ind |
If |
probs |
If |
Dave Armstrong
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.