dEdq_pois | R Documentation |
This internal function calculates the partial derivatives of expected values for a one-inflated Poisson regression model with respect to covariates. It also computes marginal effects for specified dummy variables.
dEdq_pois(b, g, X, Z, dummies, formula)
b |
Numeric vector of coefficients for the main Poisson model. |
g |
Numeric vector of coefficients for the one-inflation process. |
X |
Matrix of predictors for the main Poisson model, where rows correspond to observations and columns to covariates. |
Z |
Matrix of predictors for the one-inflation process, structured similarly to |
dummies |
Character vector of column names from |
This function:
Computes partial derivatives of expected values with respect to covariates in X
and Z
.
Handles marginal effects for dummy variables by modifying their values in the design matrices and computing the difference in expected values.
It is designed for internal use and assumes correct input structure. Improper inputs may result in errors or unexpected behavior.
A matrix of partial derivatives (or marginal effects) with rows corresponding to observations and columns to covariates. For dummy variables, marginal effects are calculated by contrasting expected values when the dummy is set to 0 versus 1.
E_pois
for computing expected values in the one-inflated Poisson model.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.