I came across 2 packages to calculate marginal effect for a logistic regression model in R with some interaction terms.
margins package https://cran.r-project.org/web/packages/margins/vignettes/Introduction.html and mfx pacakge https://cran.r-project.org/web/packages/mfx/mfx.pdf
I want to calculate the average marginal effect and don't know which package is appropriate. For some reason, I cannot use the first one. So I have tried
install.packages("margins-package")
library(margins) ## Library not found
margins(logit) ## Logit is my glm model but that function is not found
The author of the margins package criticised mfx package and other packages used to calculate marginal effect as they do not account for interaction term properly. Does anyone have experience with one of the packages or both? I'd like to hear your feedback.
Thank you!