6 Replies Latest reply on Sep 30, 2017 4:31 AM by Jim Dehner

# Gini Coefficient

Hi guys,

10.2 question. I am trying to calculate a gini coefficient. You can learn more about it here: Gini coefficient - Wikipedia

There was a prior post about it here: Gini Coefficient

Aaron's answer from the prior quesiton is giving me a 0 at each mark. I think this is due to each mark in my graph being its own partition (because each ID's Amount is summed across multiple rows of the data source). I really don't need a per-mark value, just the value for the entire graph.

Conceptually, I want twice the sum of the differences of each point from a slope=1 line.

If we can do it without displaying the underlying inverted Lorenz, that is fine.

Thanks in advance for any wizardry.

• ###### 1. Re: Gini Coefficient

Hi Ray

Can't tell you waht is going on - statistics was not my forte - and I am on a different version so you would not be able to open a workbook

That said the issue is in the Gini calc - see below

this is your chart as a cross tab - the last 3 columns are the Gini numerator - the denominator and then the manual numerator/denominator

The 6th column is the Gini calculation from formula - I also included the index and the size in the table

Don't know what the numerical result you expected but at least you can see what is being returned from the parts and total formula

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: Gini Coefficient

Hi Ray,

From Aaron's comment you dimension ID is sorted in descending order.  Should it not be sorted in Ascending order by the amount?

Then after that edit gini table compute using needs to be set to use ID.

I think that's what you're looking for.

Regards,

Gerardo

1 of 1 people found this helpful
• ###### 3. Re: Gini Coefficient

Gerardo,

Thanks a million.I need to review table calculations across specific dimensions.

Technically, yes, the sort order should be reversed (ascending), but in this case I want to graph the opposite way - I think it is more revealing. But I can simply take the abs() of the result.

Ray

• ###### 4. Re: Gini Coefficient

Jim,

Thanks for your effort. I should have given a more verbose explanation, but Gerardo was able to read between the lines. (accidental pun there)

Ray.

• ###### 5. Re: Gini Coefficient

Hi Ray,

You're welcome.  There isn't a need to take the ABS you could just reverse the sort to descending  and it'll give you what you are looking for.  Here is a pretty handy link:

Regards,

Gerardo

1 of 1 people found this helpful
• ###### 6. Re: Gini Coefficient

that's alright - you are out on the forum enough to understand

Jim