Gini Coefficient

Author

Eric W. Weisstein
November 5, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Statistics/GiniCoefficient.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/GiniCoefficient.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Example

data=Table[Random[Real,{-10,10}],{100}];

Formula 1

Plus@@Abs[Subtract@@@Flatten[Outer[List,data,data],1]]/(2Length[data]^2Mean[data])

Plus@@Abs[Flatten[Outer[Subtract,data,data]]]/(2Length[data]^2Mean[data])

Plus@@Abs[Flatten[Outer[Subtract,#,#]]]/(2Length[#]^2Mean[#])&[data]

Formula 2

Plus@@MapIndexed[(2#2[[1]]-Length[data]-1)#&,Sort[data]]/(Length[data]^2Mean[data])