This Stata do file performs a two-level multiple-group decomposition using a mediation analysis approach, as described in the article 'Decomposing ethnic achievement gaps across multiple levels of analysis and for multiple ethnic groups' published in the journal Sociological Methodology.
Gallo Cordoba B, Leckie G, Browne W.J. Decomposing Ethnic Achievement Gaps across Multiple Levels of Analysis and for Multiple Ethnic Groups. Sociological Methodology. pp. 1-31. Copyright [June 2022] (American Sociological Association). doi: 10.1177/00811750221099503