NATION

PASSWORD

Tutorial: Gini coefficient for Wiki-style Factbooks

A place to put national factbooks, embassy exchanges, and other information regarding the nations of the world. [In character]
User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Tutorial: Gini coefficient for Wiki-style Factbooks

Postby Darcania » Mon Feb 02, 2015 8:28 pm

How to calculate your nation's Gini Coefficient



Some information about the Gini Coefficient (from Wikipedia):

The Gini Coefficient is the most commonly-used measurement for income equality in a region. It ranges from 0 to 1, or from 0% to 100%, with 0 indicating that everybody has the same amount of income and 1 indicating that one person earns all of the money in the region. While it can go above 1 when the lower end's income is negative (due to, for instance, massive piles of debt), that rarely happens.

The math behind the Gini Coefficient:
Image

X Axis: People, sorted from lowest to highest and accumulated. 0 is no population, 1 is all the population.
Y Axis: Income, sorted from lowest to highest and accumulated. 0 is no income, 1 is all the income.

Lorenz curve: The graph of a region's income dispersal.
Line of Equality: What the Lorenz curve would look like with perfect income equality.

A: The area between the Lorenz curve and the Line of Equality.
B: The area between the Lorenz curve and the axes.

The Gini coefficient is the ratio between the area A and the total area of the triangle A + B. Alternatively, since the triangle A + B has base and height of 1 (making the area 0.5), the Gini coefficient is equal to 2 * A.


The Formula

Disclaimer: As NationStates only provides so much information, your actual Gini coefficient would be slightly higher than the one this formula provides you. However, this formula is as accurate as possible with the limited information provided.


First, go to your nation's Economy page. Toward the top, you should see something like this:

Image

In red is your nation's average income, which will be called I from now on.
In green is your nation's poorest 10%'s average income, which will be called L from now on.
In blue is your nation's richest 10%'s average income, which will be called H from now on.

And finally, your Gini coefficient (as a percentage) is calculated as such:

Image

Or, in text:

9 * (H - L) / I

Note: Since there has been some confusion: This formula returns your Gini as a percentage, as noted above. Do not multiply the result by 100.


For example, as is seen in the above Economy image, Darcania's average income is 42,060, its poorest average income is 30,760, and its richest average income is 55,500. Therefore:
H = 55,500;
L = 30,760; and
I = 42,060.

Thus, Darcania's Gini coefficient is:

9 * (55,500 - 30,760) / 42,060

which is equal to 5.29%.

How I derived this formula (Warning! Wall of text!):
Image
Note: Not to scale.

I started by determining a way to calculate the Gini coefficient from B instead of A, since B would have to be calculated either way:

G = A / (A + B)
G = (A + B - B) / (A + B)
A + B = 0.5
G = (0.5 - B) / 0.5
G = 1 - 2 * B

Next, some definitions:
LP = proportion of total income earned by lowest 10%
HP = proportion of total income earned by highest 10%

These will be calculated later.

Next, finding the area of B. Notice that B is composed of a triangle and two trapezoids; simply adding the areas of these three shapes will provide us with the area of B.
As a refresher, here are the formulas for calculating the areas of triangles and trapezoids:

Area of triangle = 0.5 * base * height
Area of trapezoid = 0.5 * height * (one base + second base)
And yes, I had to look up the area of a trapezoid. It's been too many years since elementary school.

Therefore:

B = 0.5 * 0.1 * LP + 0.5 * 0.8 * (LP + (1 - HP)) + 0.5 * 0.1 * ((1 - HP) + 1)

Next, since every term in right side of the equation had a factor of 0.5, I multiplied both sides by 2. Doing this now would eliminate an extra step later on, and allow us to plug in 2 * B directly into the formula for G above. I also factored out (but didn't eliminate) a factor of 0.1 to make simplification easier.

2 * B = 0.1 * (LP + 8 * (1 + LP - HP) + 1 + 1 - HP)

Distributing the 8 and combining like terms leads to:

2 * B = 0.1 * (9 * LP - 9 * HP + 10)

Distributing the 0.1 gives us the final formula for 2 * B:

2 * B = 1 + 0.9 * LP - 0.9 * HP

Substituting this result into the equation for G above produces:

G = 1 - (1 + 0.9 * LP - 0.9 * HP)

Distributing the minus sign, combining like terms, and factoring a 0.9 out leads to:

G = 0.9 * (HP - LP)

Next, we have to calculate what exactly HP and LP are, since they're not provided in the economy screen. Based off of the definitions of each of these terms, given above, we get:

LP = Total money earned by poorest 10% / Total money earned by population = 0.1 * population * L / (population * I)
Similarly, HP = 0.1 * population * H / (population * I)

Note that, for both terms, the population is in both the numerator and denominator, allowing us to cancel it out.

LP = 0.1 * L / I
HP = 0.1 * H / I

Plugging in these terms into the formula for G above results in:

G = 0.9 * (0.1 * H / I - 0.1 * L / I)

Factoring out 0.1 / I from both terms results in:

G = 0.09 * (H - L) / I

Finally, multiplying by 100 will give us G as a percentage:

G (as a percentage) = 9 * (H - L) / I

And now we have a formula for G using only easily-accessible numbers.


Feel free to ask any questions.

Enjoy knowing (and showing off) you nation's Gini coefficient!

Note: As a favor to me, when posting a Gini coefficient calculated using this method, please link to this post, as a way of crediting me and showing anyone who is curious how to calculate theirs. I spent quite a few hours working on this, and would enjoy any credit.
For example, if posting it on a Factbook based on Ponderosa's template, you could put in the following entry in your sidebar:

Code: Select all
[b][url=http://forum.nationstates.net/viewtopic.php?f=23&t=329515]Gini[/url]:[/b] 5.29
[hr]
Last edited by Darcania on Sun Feb 22, 2015 11:58 am, edited 8 times in total.

User avatar
Skappola
Minister
 
Posts: 2063
Founded: May 12, 2013
Ex-Nation

Postby Skappola » Mon Feb 02, 2015 9:01 pm

I got a GINI coefficient of 29%, or about that of Mexico. I'm not sure what I expected, but it's still nice to know. :p (Top 10% is about $550,000 & Bottom 10% is about $34,000, average is $160,000)

So is this statistic used in determining the income equality statistic, or is that just based on the issues?
Political Compass: Economic: 1.63 Social: -6.72
Political Ideology: Neoliberal Civil Libertarian
I Enjoy: Blues, Paradox Games and Sci-fi

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Mon Feb 02, 2015 9:06 pm

Skappola wrote:I got a GINI coefficient of 29%, or about that of Mexico. I'm not sure what I expected, but it's still nice to know. :p (Top 10% is about $550,000 & Bottom 10% is about $34,000, average is $160,000)

So is this statistic used in determining the income equality statistic, or is that just based on the issues?


I don't think this statistic is used by NS itself in any way. It's just a way to make any Wiki-style factbook about your nation appear more Wiki-like, by using a statistic that Wikipedia itself uses.

User avatar
Skappola
Minister
 
Posts: 2063
Founded: May 12, 2013
Ex-Nation

Postby Skappola » Mon Feb 02, 2015 9:12 pm

Darcania wrote:
Skappola wrote:I got a GINI coefficient of 29%, or about that of Mexico. I'm not sure what I expected, but it's still nice to know. :p (Top 10% is about $550,000 & Bottom 10% is about $34,000, average is $160,000)

So is this statistic used in determining the income equality statistic, or is that just based on the issues?


I don't think this statistic is used by NS itself in any way. It's just a way to make any Wiki-style factbook about your nation appear more Wiki-like, by using a statistic that Wikipedia itself uses.

I didn't mean specifically this statistic, but just the statistics that Nationstates gives out. For example, it says that my rich citizens are 16 times richer than my poor citizens. Despite this large amount of inequality, I still have a decent amount of equality in the income equality statistic (On the analysis). There seems to be a disconnect there.
Last edited by Skappola on Mon Feb 02, 2015 9:12 pm, edited 1 time in total.
Political Compass: Economic: 1.63 Social: -6.72
Political Ideology: Neoliberal Civil Libertarian
I Enjoy: Blues, Paradox Games and Sci-fi

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Mon Feb 02, 2015 9:17 pm

Skappola wrote:
Darcania wrote:
I don't think this statistic is used by NS itself in any way. It's just a way to make any Wiki-style factbook about your nation appear more Wiki-like, by using a statistic that Wikipedia itself uses.

I didn't mean specifically this statistic, but just the statistics that Nationstates gives out. For example, it says that my rich citizens are 16 times richer than my poor citizens. Despite this large amount of inequality, I still have a decent amount of equality in the income equality statistic (On the analysis). There seems to be a disconnect there.


That would be because a ratio of 16 is actually pretty low. There are nations where the ratio is in the thousands. For example, Papa Legba (currently ranked 2nd in Most Extreme in today's Census) has a ratio of 1,948 to 1.

User avatar
Klarliert
Civilian
 
Posts: 1
Founded: Feb 04, 2015
Ex-Nation

Postby Klarliert » Wed Feb 04, 2015 2:34 pm

Mine's 10.7%.

User avatar
Lzherusskia
Diplomat
 
Posts: 503
Founded: Mar 29, 2010
Ex-Nation

Postby Lzherusskia » Wed Feb 04, 2015 3:58 pm

Excellent post. Tagging this for future reference.

User avatar
Allied Connurist States
Minister
 
Posts: 2882
Founded: Jul 15, 2014
Left-Leaning College State

Postby Allied Connurist States » Wed Feb 04, 2015 4:09 pm

Okay, I followed the formula and I have 4.61771636247454....

How do I convert this to a percentage?

Is it simple as just adding a % to the number I got?
Brytene wrote:brb gonna goteach some spanish people the secrets of a tasty lancashire hotpot as part of my secret imperialist ambitions

#ValaranSoSexy | I BELIEVE IN THE EASTER CAMEL | Excellent Stallion-Like Gentleman, Commander of Ugandan Skies, Rabbipriest of Amin Temple Kampala, Commissar of DPRK State Facilities, of Excellent Stallion-Like Affairs ,and of Internet Surveillance.Glory to Idi Amin! Remove the Obote scum!

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Wed Feb 04, 2015 4:13 pm

Allied Connurist States wrote:Okay, I followed the formula and I have 4.61771636247454....

How do I convert this to a percentage?

Is it simple as just adding a % to the number I got?


Yep. So you have a Gini coefficient of 4.62%.

Lzherusskia wrote:Excellent post. Tagging this for future reference.


Glad I could help. :)
Last edited by Darcania on Wed Feb 04, 2015 5:09 pm, edited 1 time in total.

User avatar
Allied Connurist States
Minister
 
Posts: 2882
Founded: Jul 15, 2014
Left-Leaning College State

Postby Allied Connurist States » Wed Feb 04, 2015 4:21 pm

Darcania wrote:
Allied Connurist States wrote:Okay, I followed the formula and I have 4.61771636247454....

How do I convert this to a percentage?

Is it simple as just adding a % to the number I got?


Yep. So you have a Gini coefficient of 4.62%.

Thanks.
Brytene wrote:brb gonna goteach some spanish people the secrets of a tasty lancashire hotpot as part of my secret imperialist ambitions

#ValaranSoSexy | I BELIEVE IN THE EASTER CAMEL | Excellent Stallion-Like Gentleman, Commander of Ugandan Skies, Rabbipriest of Amin Temple Kampala, Commissar of DPRK State Facilities, of Excellent Stallion-Like Affairs ,and of Internet Surveillance.Glory to Idi Amin! Remove the Obote scum!

User avatar
Arkolon
Powerbroker
 
Posts: 9498
Founded: May 04, 2013
Ex-Nation

Postby Arkolon » Wed Feb 04, 2015 4:25 pm

I have a huge spreadsheet used for calculus (integration) to work out RP Ginis, but this system of yours really is ingenius. Well done.
"Revisionism is nothing else than a theoretic generalisation made from the angle of the isolated capitalist. Where does this viewpoint belong theoretically if not in vulgar bourgeois economics?"
Rosa Luxemburg

User avatar
Nickel Empire
Minister
 
Posts: 2126
Founded: Jan 05, 2014
Corporate Bordello

Postby Nickel Empire » Wed Feb 04, 2015 4:34 pm

How do you do bottom 10%?
Purple Tory with some Right-Wing Populism
"Every nation has the government it deserves." Joseph de Maistre
"First feelings are always the most natural." King Louis XIV of France
Trademark: Agent Orange Is a Protest Violent? Code: Reaganomics
"Don't tickle the Nickel." https://imgur.com/5KfGQGt

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Wed Feb 04, 2015 5:07 pm

Nickel Empire wrote:How do you do bottom 10%?


What do you mean? Do you mean "how do you find out the poorest 10%'s income"? It's listed in your economy page.
According to your economy page, your richest 10% earn 1,157,711 Nickels on average, your poorest 10% earn 20,120 Nickels on average, and your whole population earns 212,852 Nickels on average.

Therefore, your nation's Gini coefficient is:

9 * (1,157,711 - 20,120) / 212,852
or
48.1%.

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Wed Feb 04, 2015 5:09 pm

Arkolon wrote:I have a huge spreadsheet used for calculus (integration) to work out RP Ginis, but this system of yours really is ingenius. Well done.


That is what I used to find out the final formula (though, since only a few points were provided, a trapezoidal sum was the only way to go). Feel free to check out the math in the second spoiler tag in the OP if you're interested.

User avatar
Sidh Ohn
Diplomat
 
Posts: 696
Founded: Mar 05, 2007
Ex-Nation

Postby Sidh Ohn » Wed Feb 04, 2015 5:37 pm

10.28% Only Greenland, Japan, and a couple northern european countries have manged this in RL. :clap:

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Wed Feb 04, 2015 5:51 pm

Sidh Ohn wrote:10.28% Only Greenland, Japan, and a couple northern european countries have manged this in RL. :clap:


Yeah, NationStates really exaggerates your nation. It's very rare to find a nation here that actually manages to get in the range most RL countries are actually in, let alone near the average.

User avatar
Nickel Empire
Minister
 
Posts: 2126
Founded: Jan 05, 2014
Corporate Bordello

Postby Nickel Empire » Wed Feb 04, 2015 7:10 pm

Darcania wrote:
Nickel Empire wrote:How do you do bottom 10%?


What do you mean? Do you mean "how do you find out the poorest 10%'s income"? It's listed in your economy page.
According to your economy page, your richest 10% earn 1,157,711 Nickels on average, your poorest 10% earn 20,120 Nickels on average, and your whole population earns 212,852 Nickels on average.

Therefore, your nation's Gini coefficient is:

9 * (1,157,711 - 20,120) / 212,852
or
48.1%.

Let me rephrase that, how do you calculate how much the bottom 10% owns of the total wealth? I assume the number you do get is how much the top 10% owns of the total wealth.
Purple Tory with some Right-Wing Populism
"Every nation has the government it deserves." Joseph de Maistre
"First feelings are always the most natural." King Louis XIV of France
Trademark: Agent Orange Is a Protest Violent? Code: Reaganomics
"Don't tickle the Nickel." https://imgur.com/5KfGQGt

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Wed Feb 04, 2015 7:27 pm

Nickel Empire wrote:Let me rephrase that, how do you calculate how much the bottom 10% owns of the total wealth? I assume the number you do get is how much the top 10% owns of the total wealth.


Under the second "Math..." spoiler tag is how I derived the formula, but I'll post a snippet of it to answer your question:

LP = proportion of total income earned by lowest 10%
HP = proportion of total income earned by highest 10%

LP = Total money earned by poorest 10% / Total money earned by population = 0.1 * population * L / (population * I)
Similarly, HP = 0.1 * population * H / (population * I)

Note that, for both terms, the population is in both the numerator and denominator, allowing us to cancel it out.

LP = 0.1 * L / I
HP = 0.1 * H / I

Does that answer your question? If not, I apologize for missing the mark again.
Last edited by Darcania on Wed Feb 04, 2015 7:27 pm, edited 1 time in total.

User avatar
Syrixia
Diplomat
 
Posts: 813
Founded: Oct 11, 2014
Ex-Nation

Postby Syrixia » Mon Feb 16, 2015 3:27 pm

I got 8.17.
SYRIXIA
Former TNP Minister of Culture and Champion Shitposter

User avatar
Yesovenda
Civil Servant
 
Posts: 6
Founded: Nov 29, 2011
Ex-Nation

Postby Yesovenda » Mon Feb 16, 2015 4:12 pm

5.88 for me. Almost of the nations that have done this sem to be left leaning.

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Tue Feb 17, 2015 10:39 pm

YesoVenda wrote:5.88 for me. Almost of the nations that have done this sem to be left leaning.


Maybe it's because my nation is left-leaning. Everybody knows that nobody listens to the other side when it comes to politics. :)

User avatar
Yulis
Chargé d'Affaires
 
Posts: 369
Founded: Mar 12, 2012
Left-Leaning College State

Postby Yulis » Wed Feb 18, 2015 12:16 am

I get 1.78%, which appears to be really good (if income equality is desirable, although it sounds good to me). Yay for Socialism.
HI! *waves furiously*
Yulis is a big nation of football-loving Socialists, metal-heads, and cat videos. In the way that American "left-wing extremists" are centre-right politicians to the rest of the world, Yulisian "right-wing extremists" are centre-left politicians to the rest of the world.

I'm a person, I live in New Zealand. If you wondered, I am probably laughing at your country right now, but I'll be crying fairly shortly. This stuff is great.

User avatar
Yesovenda
Civil Servant
 
Posts: 6
Founded: Nov 29, 2011
Ex-Nation

Postby Yesovenda » Thu Feb 19, 2015 11:09 am

Darcania wrote:
YesoVenda wrote:5.88 for me. Almost of the nations that have done this sem to be left leaning.


Maybe it's because my nation is left-leaning. Everybody knows that nobody listens to the other side when it comes to politics. :)


That's why I love and hate politics. :lol:

User avatar
New Aerios
Minister
 
Posts: 2250
Founded: Apr 19, 2013
Ex-Nation

Postby New Aerios » Thu Feb 19, 2015 1:15 pm

80.14%, high score, I win.
-------------------------------I--M--P--E--R--I--V--M----N--O--V--A----A--E--R--I--O--S---------------------------------
"No matter how worthy the cause, it is robbery, theft, and injustice to confiscate the property of one person and give it to another to whom it does not belong"

"Prior to capitalism, the way people amassed great wealth was by looting, plundering and enslaving their fellow man. Capitalism made it possible to become wealthy by serving your fellow man."
------------------------------------------------------------------------------------------------------------------------------------

User avatar
Electrum Diplomatic Offices
Chargé d'Affaires
 
Posts: 387
Founded: Mar 12, 2014
Ex-Nation

Postby Electrum Diplomatic Offices » Thu Feb 19, 2015 11:55 pm

I've never seen a more beautiful combination mathematics and statistics in my life. Well done. This definitely deserves more recognition.
Manager of Electrum Commerce: co-owner of Air Terranea, co-owner of Dream Games (thread) and manages the Electrum Airports Authority
Shocking at WorldVision
Electrum Statistics Office and Electrum Embassy Programme

Next

Advertisement

Remove ads

Return to Factbooks and National Information

Who is online

Users browsing this forum: MauzerX

Advertisement

Remove ads