Dear statisticians,

I want to test whether a variable M plays a mediating role in the effect of X on Y. I know it is quite easy to use medeff command in Stata, but the problem is that the response variable Y is a non-negative one, meaning a count model is more appropriate. Thus, medeff command cannot help.

How can I test the (causal) meditation effect in this situation using Stata? Looking forward to your insightful comments. Thank you in advance!