*! version 0.1.0 08jun2026

ordaxaca

ordaxaca -- Nonlinear Oaxaca decomposition for ordered outcomes

Syntax

ordaxaca depvar indepvars [if] [in] [weight],
by(groupvar)
base(#)
compare(#)
[
model(ologit|oprobit)
outcomes(numlist)
svy
estopts(string)
]

Description

ordaxaca estimates a twofold nonlinear Oaxaca decomposition for ordered
dependent variables. The command estimates separate ordered logit or ordered
probit models for a base group and a comparison group. It then decomposes
differences in predicted outcome probabilities into explained and unexplained
components.

For each requested ordered outcome category k, the command computes the base
group's mean predicted probability, the comparison group's mean predicted
probability, and a counterfactual mean predicted probability that applies the
base group's coefficient structure to the comparison group's covariate
distribution.

Options

by(groupvar) specifies the grouping variable. This option is
required.

base(#) specifies the base group. The reported difference is
base minus comparison. This option is required.

compare(#) specifies the comparison group. This option is
required.

model(ologit|oprobit) specifies the ordered-response model. The default is
model(ologit).

outcomes(numlist) specifies which outcome categories to
decompose. If omitted, all observed outcome categories are used.

svy requests survey estimation using the current svyset design. When
svy is specified, the command estimates group-specific models using
svy, subpop().

estopts(string) passes additional estimation options to
ologit or oprobit.

Decomposition

For outcome category k, define:

Base mean: Pr(Y=k | X_base, b_base)

Counterfactual mean: Pr(Y=k | X_compare, b_base)

Comparison mean: Pr(Y=k | X_compare, b_compare)

The command reports:

Diff = Base mean - Comparison mean

Explained = Base mean - Counterfactual mean

Unexplained = Counterfactual mean - Comparison mean

Examples

Basic ordered logit decomposition:

. ordaxaca y x1 x2 i.x3, by(group) base(0) compare(1) outcomes(1 2 3)

Ordered probit decomposition:

. ordaxaca y x1 x2 i.x3, by(group) base(0) compare(1) outcomes(1 2 3) model(oprobit)

Survey design example:

. svyset psu [pweight=weight], strata(strata) singleunit(centered)

. ordaxaca y x1 x2 i.x3, by(group) base(0) compare(1) outcomes(1 2 3) svy

Bootstrap example:

. bootstrap diff_out3=_b[diff_out3] expl_out3=_b[expl_out3] unex_out3=_b[unex_out3], reps(500) seed(123): ordaxaca y x1 x2 i.x3, by(group) base(0) compare(1) outcomes(3)

Stored results

ordaxaca stores the following in e():

e(b) row vector of decomposition estimates

e(V) variance matrix; zero matrix unless resampled externally

e(decomp) matrix with outcome, base mean, counterfactual mean, comparison mean, difference, explained, and unexplained components

e(N_base) number of observations in the base group

e(N_compare) number of observations in the comparison group

e(cmd) ordaxaca

e(depvar) dependent variable

e(indepvars) independent variables

e(by) grouping variable

e(model) ordered-response model used

e(outcomes) outcome categories decomposed

e(base) base group

e(compare) comparison group

e(svy) survey option indicator

Remarks

The decomposition is descriptive unless supported by a credible causal research
design. The unexplained component should not automatically be interpreted as
discrimination or as a causal structural effect.

For ordered logit, the model relies on the proportional-odds assumption. For
ordered probit, the analogous single-index threshold structure is assumed.

Poor overlap in covariates across groups can make counterfactual predictions
fragile. Users should inspect covariate overlap and conduct robustness checks.

This version reports aggregate twofold decomposition components. It does not yet
implement detailed variable-by-variable decomposition.

Author

Refat Mishuk

UNM

mishuk.refat@gmail.com