The causal decomposition now targets marginal counterfactual inequality by default, rather than residual (conditional) inequality. Within-group variance is computed by the law of total variance over the covariate distribution of the treated within each group: the average conditional residual variance plus the dispersion of predicted conditional means across covariate profiles. Control variables that adjust the counterfactual predictions therefore contribute to within-group inequality. When the model contains no within-group control variation, the marginal and residual results coincide, so analyses without controls are unaffected.
New features
New estimand argument on ineqx() and ineqx_params(): "marginal" (default) or "residual". The "residual" variant reproduces the previous behavior (conditional scale parameter only, omitting the predicted-mean dispersion term). The chosen estimand is recorded on the params/result objects and shown by print().
Marginal delta-method standard errors use a numerical Jacobian of the full prediction + g-computation routine (the marginal group variance is nonlinear in both the mean- and scale-equation coefficients); the residual variant keeps the fast analytical Jacobian. The bootstrap path honors estimand throughout. The marginal Jacobian is evaluated with incremental finite differences (each coefficient perturbation is a rank-1 update of the cached predictions), making it O(N * p) rather than O(N * p^2) – nearly as fast as the analytical path even for models with large coefficient counts.
ineqx 0.4.0
Breaking changes
Merged ineq() and ineqx() into a single ineqx() function
If no treat is specified: descriptive decomposition (was ineq())
If treat is specified or params provided: causal decomposition
ineq() removed — use ineqx() without treat instead
y is now a separate argument (character, column name in data); formula_mu is now one-sided (like formula_sigma)
boot_config() now requires y argument and one-sided formula_mu
Default order changed from c("behavioral", "compositional", "pretreatment") to "shapley"
Argument order: y, ystat, treat, post, group, time, ref, order, formula_mu, formula_sigma, params, weights, se, data