I haven't used the Gini coefficient in the last 25 years, so I can't give more
complete advice. However, from your description, you can can get such a sum
without a macro by
RANK VARIABLE= income (d) /rank into r_income.
* to get the rank for each case.
WEIGHT BY r_income.
* to turn on weighting.
DESCRIPTIVES VARIABLES= r_income /statistics=sum.
Isn't the graph that the GINI coefficient summarizes something like
X= proportion of people with this income or lower
Y= proportion of dollars to people with this income or lower?
p.s. check what you want to do with ties.
MichalB wrote:
> Hello to all.
>
> Recently I needed to compute the Gini coefficient in SPSS. When I found,
> that there is no possibility to get it via DESCRIPTIVES or FREQ procedure I
> tried to write a macro which would compute it for me.
>
> Unfortunately I don't have much experience in macro writing, I don't know
> how to do it. I used the equation from Sen's "On Economic Inequality", where
> G is expressed as a function of a weighted sum of all personal incomes with
> ordinal weights (1 for the richest, 2 for the second richest etc). I didn't
> know how to compute this sum in SPSS macro and than use it in further
> operations.
>
> I have also visited WWW.SPSS.COM, but such a macro was anavailable.
>
> Is anyone of you able to give me some brief advise how to cope with the
> problem
>
> Thank you in advance
>
> Michal Bojanowski
=================================================================
Instructions for joining and leaving this list and remarks about
the problem of INAPPROPRIATE MESSAGES are available at
http://jse.stat.ncsu.edu/
=================================================================