This repository shows how to use Stata and R code to calculate distribution-weighted average marginal effects (DAME) and make contourplots and heatmaps of marginal effects in non-linear models with interactive codes. The motivation behind these tools is more clearly laid out in the paper "Taking Distributions Seriously: On the Interpretation of the Estimates of Interactive Nonlinear Models" by Andrei Zhirnov, Mert Moral, and Evgeny Sedashov.
- The folder
Stata-marginscontains Stata do-files that plot DAME and contour-plots and heatmaps of the marginal effects. These do-files rely on the margins module for calcualtions and include instructions for obtaining the datasets they use. - The folder
Stata-code-with-matacontains older Stata do-files that plot DAME and contour-plots and heatmaps of the marginal effects. These do-files rely on mata for calcualtions and include instructions for obtaining the datasets they use. - using-DAME-on-R-with-annotations uses the same examples to show how to use the DAME package in R. The corresponding R Markdown file can be found in
doc-files. - Stata-margins-examples is a document with the Stata code that relies on margins.
- Stata-examples-with-mata is the Stata+mata code with more extensive annotatations