dfee | R Documentation |
Computes marginal first-exposure effects from a fitted oneinfl
model.
Dummy variables are automatically detected as those with exactly two unique values
in the data, and corresponding marginal effects are instead calculated by differencing
the FEE between both values of the dummy.
dfee(model, data, at = "AE")
model |
A fitted model object of class |
data |
A data frame containing the variables used to fit the model. |
at |
A character string or list. Specifies where the marginal FEE should be evaluated.
Options are |
The marginal effects can be evaluated in three ways, determined by the at
argument:
"AE"
: Average over all data points (default).
"EM"
: Evaluate at the sample means of the covariates.
list
: Evaluate at a user-specified set of covariate values.
A list with components:
dfee
A named numeric vector of estimated marginal first-exposure effects for each variable.
sefee
A numeric vector of standard errors corresponding to the marginal effects.
where
A character string describing the evaluation point.
fee
, dfee_pois
, dfee_nb
df <- data.frame(x = runif(10,0,10), d = sample(c(0,1), 10, replace=TRUE), y = rpois(10, 3) + 1)
model <- oneinfl::oneinfl(formula = y ~ x + d | x + d, df = df, dist = "Poisson")
dfee(model, data = df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.