Hi Folks,
Has anyone used the inequality measures syntax at the link below to
calculate the Gini Index at the zip code level? I would like to end up
with a single file showing each zip and the corresponding Gini
coefficient. I don't care about the rest of the inequality measures or
producing the Lorenz curve.
Because it is a fairly long program, I thought it better to provide the
link. Happy to post it if preferred. Credit for the program goes to
Raynald Levesque.
http://www.spsstools.net/Syntax/Inequality/ManyTestsOfInequalityV5.txtI am also unsure of what the best way is to structure the data for the
calculations. At present, I have it in this format (because it works
when there is only one zip in the data file:
Group a e
zip1 89 5000
zip1 109 12500
zip1 60 17500
zip1 56 22500
zip1 87 27500
zip1 49 32500
zip1 90 37500
zip1 99 42500
zip1 110 47500
zip1 101 55000
zip1 70 67500
zip1 69 87500
zip1 65 112500
zip1 50 137500
zip1 45 175000
zip1 21 389764
zip2 50 5000
zip2 66 12500
zip2 67 17500
zip2 70 22500
zip2 88 27500
zip2 90 32500
zip2 98 37500
zip2 101 42500
zip2 109 47500
zip2 111 55000
zip2 94 67500
zip2 88 87500
zip2 70 112500
zip2 51 137500
zip2 43 175000
zip2 19 465600
Where "Group" is the zip code, and "a" is the number of people in the
corresponding zip code making "e" dollars. Note that the values of "e"
are the same for each zip code with the exception of the last value for
each zip. The matching values in "e" represent the mid-points of the
income categories used by the census. However, the last value is the
mean income for people making over $200,000 -- which varies by zip code.
I can successfully run the program for a single zip code, but don't yet
have the programming skills to adapt it to run on all of them at once
and produce a single file showing the Gini for each zip. I am hoping
that someone might have done this before and can share the adapted
syntax, or at least give me an idea of what steps would be necessary to
adapt the program myself. Thanks for whatever advice you can provide!
~David