GINI Based on Reputation

1

Please login or register to vote for this query.

(click on this box to dismiss)

Statistical Analysis

Q&A for people interested in statistics, machine learning, data analysis, data mining, and data visualization

-- To turn this into GINI, need to calculate
-- NumX = SUM( (N_Peop + 1 - RankInt)*Reputation )
-- #1 = (N_Peop + 1)/(N_Peop)
-- #Num = 2*NumX
-- #Den = N_Peop*Sum_Rep
-- Gini = #1 - (#Num/#Den)
-- http://www.had2know.com/academics/gini-coefficient-calculator.html
-- for larger sites will have to figure out how folks with 1 or those below cut-off
-- contribute to NumX, if you go as is - treats them as effectively rep=0

SELECT Reputation, N_Peop, Sum_Rep,
ROW_NUMBER() OVER(ORDER BY Reputation ASC) AS RankInt
FROM Users 
CROSS JOIN
(SELECT COUNT(*) AS N_Peop, SUM(Reputation) AS Sum_Rep FROM USERS) AS Agg
WHERE Reputation > 1
ORDER BY Reputation DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results