Thursday, June 26, 2008

Calculating decomposition of Gini coefficient in R

I am working on several projects on fiscal disparities. The level of inequality can be measured by summary indices such as the Gini coefficient, but I like to move a step forward and decompose the aggregate inequality value into its relevant component contributions.

Take income inequality as an example. One way of factor decomposition is to separate the effects of multiple income streams that form the total income. It has been proposed that a Gini coefficient can be separated as multiple components based on a weighted average of pseudo-Gini (Fei et al 1978; Shorrocks 1982). With this method, for each revenue stream, we can calculate its absolute contribution, relative contribution, and marginal effect (Lerman and Yitzhaki 1985) to the inequality (Gini) of total income.

How to do this in R? Failed to find any package ("library") that can do it directly, I decided to create the function on my own by revising R codes from known packages such as ineq and reldist. It turns out to be easy and really fun!

The formulas:




An simulated example:




1 comment:

0s0-Pa said...

Interesting to see how it can correlate to any type of nonprofit software or database software.