x1: a numeric vector for the first year/dataset containing at least non-negative elements.
z1: a factor for the first year/dataset containing the population subgroups.
weights1: an optional vector of weights of x for the first year/dataset to be used in the computation of the decomposition. Should be NULL or a numeric vector.
x2: a numeric vector for the second year/dataset containing at least non-negative elements.
z2: a factor for the second year/dataset containing the population subgroups.
weights2: an optional vector of weights of x for the second year/dataset to be used in the computation of the decomposition. Should be NULL or a numeric vector.
Returns
a list with the results of the decomposition and the parts used for the decomposition, containing the following components: - mld_data1: the value of the mean log deviation index of x for the first year/dataset, and the decomposition into within-group and between-group inequality
mld_data2: the value of the mean log deviation index of x for the second year/dataset, and the decomposition into within-group and between-group inequality
mld_difference: the difference between the mean log deviation and the decomposition between the second and first year/dataset
absolute_contributions_difference: decomposition of the absolute change in inequality into: within group changes, group size changes (split into the effect of within and between group components) and between group changes.
relative_contributions_difference: decomposition of the change in inequality into relatieve contributions of: within group changes, group size changes and between group changes. Adds up to 100 percent (or -100 percent for negative change)
note: number of zero or negative observations in both datasets. The mean log deviation uses a logarithmic transformation of x. Therefore these observations are deleted from the analysis
Details
The change of the mean log deviation can be decomposed into three components: inequality changes between and within groups and changes in the relative sizes of the groups. The change of between group inequality is measures by a change in the relative income of the subgroups. The change of within group inequality by adding up all changes in mean log deviation within the subgroups. And the contribution of changes in relative population size effects the change on both the within and between group components. For the relative contributions those two are added together.
This method is introduced by Mookherjee and Shorrocks. It is an accurate approximation of the exact decomposition. It uses a logarithmic transformation of the values of the distribution. Therefore it cannot handle negative or zero values. Those are excluded from the computation in this function.
Examples
#Decomposition of the change in mean log deviation by level of eduction using#Mexican Income data setdata(mex_inc_2008)change_education <- mld_change(x1=mex_inc_2008$income, z1=mex_inc_2008$education,weights1=mex_inc_2008$factor, x2=mex_inc_2016$income, z2=mex_inc_2016$education,weights2=mex_inc_2016$factor)#selection of the output: decomposition of the change into within- and between-group#contribution and change in de size of groups (adds up to 100 percent)change_education["relative_contributions_difference"]
References
Mookherjee, D. and A. Shorrocks (1982) A decomposition analysis of the trend in UK income inequality, Economic Journal, 92 (368), p. 886-902.
Brewer M., and L. Wren-Lewis (2016) Accounting for Changes in Income Inequality: Decomposition Analyses for the UK, 1978–2008. Oxford Bulletin of economics and statistics, 78 (3), p. 289-322,