totalme
Holistic effect size measures for nominal and ordinal outcome models
totalme (Total Marginal Effect) is a companion package to Mize and Han’s 2025 Sociological Science article, “Inequality and Total Effect Summary Measures for Nominal and Ordinal Variables.” In a model with several outcome categories – a multinomial or ordered logit or probit, or a generalized ordered logit – a predictor has one marginal effect per category, and no single one of them says how much the predictor matters. totalme summarizes them in a single Total marginal effect: the sum of the absolute values of the marginal effects across all outcome categories, divided by two, which is the total amount of probability the predictor moves between the categories.
totalme handles any kind of independent variable. For a continuous or binary variable the Total ME is built from its marginal effect on each outcome. For a nominal variable it is built from the ME inequality of meinequality on each outcome, giving a Total ME inequality (weighted or unweighted). It works for one model or for two; with two models the difference in Total ME across the models is tested.
Installation
net install totalme, from("https://tdmize.github.io/data") replacetotalme requires the suest2 package and Stata 16 or later.
Where to start
- Options goes through every option with an example of each.
- The Examples in the sidebar reproduce the examples from Mize and Han (2025): Total MEs for a single model, comparisons across models, and Total ME inequalities for nominal predictors.
- Examples from the help file runs the help file’s examples, and the help file is on the site.
- The same summary is available as the
totalmeoption ofmecompare, which places it above the per-outcome marginal effects it summarizes. - To calculate it in R, see Total marginal effects in R.
Basic syntax
For a single model, fit it and call totalme with the variable(s):
mlogit ...
totalme varlistFor two models, store them and name both in models():
ologit dv iv1 iv2, vce(robust)
est store basemod
ologit dv iv1 iv2 med1 med2, vce(robust)
est store medmod
totalme varlist, models(basemod medmod)For two models fit on separate samples, add groups:
totalme varlist, models(grp1mod grp2mod) groupsA first example
sysuse nlsw88, clear(NLSW, 1988 extract)
drop if missing(occupation)(9 observations deleted)
recode occupation (1/2 = 1 "Professional/managerial") (3/5 = 2 "Sales/clerical/craft") ///
(6/13 = 3 "Other"), gen(occ3)(1,920 differences between occupation and occ3)
.
quietly mlogit occ3 i.collgrad c.age i.south, vce(robust).
totalme collgradTotal ME Estimates (N = 2237)
| Estimate Std. err. z P>|z|
-------------------------+-----------------------------------------------
collgrad |
College gr vs Not colleg | 0.245 0.021 11.474 0.000
The Total ME of a college degree is the total change in the predicted distribution across the three occupation groups.
Citation
Please cite the use of totalme by citing the corresponding article:
Mize, Trenton D. and Bing Han. 2025. “Inequality and Total Effect Summary Measures for Nominal and Ordinal Variables.” Sociological Science 12: 115–157.