Is it meaningful to calculate predicted marginal effects of a count data model with an interaction effect? In a little regression model of mine, I estimate the following formula a a negative binomial regression type (it would hold for a Poisson regression as well):
$$
y = \beta * var1 + \gamma * var1 * binary + \delta * X + \epsilon
$$
where $X$ is a matrix of control variables that are all on a discrete scale. $var1$ however is not discrete while $binary$ of course is a binary variable. The second term, $ \gamma * var1 * binary$ is dedicated to check how $var$ acts different if $binary=1$.
Now I compute marginal effects, say with the mfx package for R. Since count data models are GLM, the marginal effects are evaluated at some value of all the other variables (typically the mean). But I wonder whether it is meaningful to evaluate $\partial y/\partial var1$ while holding $var1 * binary$ at the mean. Or did I misunderstand the concept of average marginal effects for GLMs?
 A: In a Poisson model,
$$E[y \vert x]=\exp(\alpha + \beta x + \gamma x \cdot b).$$
The derivative would be
$$\frac{\partial E[y \vert x]}{\partial x}=\frac{\partial \exp(\alpha + \beta x + \gamma x \cdot b )}{\partial x}=\exp(\alpha + \beta x + \gamma x \cdot b)\cdot(\beta+\gamma b).$$
This is a function of $x$ and $b$, and folks create many types of marginal effects. One option is to use the means, but that might be weird for binary variables since you might evaluate the derivative for someone who is .75 female. It might be strange for continuous variables if $x$ has a weird distribution. Another option is to set all the dummies to their modes or to zero, the base.
Another option is to use own values of the covariates for each observation and then average the derivatives. Personally, I like this one the most.
mfx allows you to easily do the first with atmean=TRUE and the last with atmean=FALSE. However, I am not sure if it will handle interactions on the fly, so it may omit the $\gamma b$ term.
