Gini Coefficient - Reputation Inequality


Please login or register to vote for this query.

(click on this box to dismiss)

Calculate the Gini Coefficient (Also known as the Gini Index) for inequality. -- THIS IS CURRENTLY AN ERRONEOUS CALCULATION, DON'T RELY ON IT! --

Interpersonal Skills

Q&A for people looking to improve their interpersonal communication skills

DECLARE @numUsers int

SELECT @numUsers = COUNT(*) FROM Users

DECLARE @totalRep float

SELECT @totalRep = SUM(Users.Reputation) FROM Users

DECLARE @giniNominator float

SELECT @giniNominator = SUM( (@numUsers + 1 - CAST(Users.Id as Float)) * CAST(Users.Reputation as Float)) FROM Users

DECLARE @giniCalc float

SELECT @giniCalc = (@numUsers + 1 - 2*(@giniNominator / @totalRep)) / @numUsers

SELECT @giniCalc

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results