Dear Statalist,
I ran a zero-inflated negative binomial model, and want to show average marginal effects (AME) for main independent variables. I am seeking to use actual observations in the dataset and get the average, and believe that AME achieves the goal (unlike Marginal Effects at Means (MEM)). Assuming this is correct, I first ran ZINB:
zinb DV IVlist i.year, inflate(IVlist) robust
Some of the variables in the list of independent variables are dichotomous. Let's say it is a gender variable indicating male/female, with gender=0 male and gender=1 female.
I now want to show the change as the gender variable goes from 0 to 1, both numerically and visually (the latter involves marginsplot). However, I am confused about the following: What exactly is the difference between margins, dydx(gender) and margins, dydx(gender) at(gender=(0 1)) ? To show the average marginal effects as gender goes from 0 to 1, I think I should do the latter, correct? But when I calculate the change associated with the latter code, it does not match the number I get as a result of margins, dydx(gender).
Sorry that I couldn't use real data as it is confidential, but I hopefully provided enough background conceptually for a discussion. Thank you very much!
I ran a zero-inflated negative binomial model, and want to show average marginal effects (AME) for main independent variables. I am seeking to use actual observations in the dataset and get the average, and believe that AME achieves the goal (unlike Marginal Effects at Means (MEM)). Assuming this is correct, I first ran ZINB:
zinb DV IVlist i.year, inflate(IVlist) robust
Some of the variables in the list of independent variables are dichotomous. Let's say it is a gender variable indicating male/female, with gender=0 male and gender=1 female.
I now want to show the change as the gender variable goes from 0 to 1, both numerically and visually (the latter involves marginsplot). However, I am confused about the following: What exactly is the difference between margins, dydx(gender) and margins, dydx(gender) at(gender=(0 1)) ? To show the average marginal effects as gender goes from 0 to 1, I think I should do the latter, correct? But when I calculate the change associated with the latter code, it does not match the number I get as a result of margins, dydx(gender).
Sorry that I couldn't use real data as it is confidential, but I hopefully provided enough background conceptually for a discussion. Thank you very much!
Comment