Gini coefficient for number of posts

0

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

with a as
(   select count(id) n_posts,
           OwnerUserId
    from Posts
    where PostTypeId = 2 and
          datepart(year, CreationDate)=2019 
    group by OwnerUserId, datepart(month, CreationDate) 
) 
, b as 
(
  Select 
      count(n_posts) OVER(ORDER BY n_posts+0.000000001*OwnerUserId Desc) users_quantile, 
      sum(n_posts) OVER(ORDER BY n_posts+0.000000001*OwnerUserId Desc) posts_quantile
  from  a
)



select b.users_quantile, 
       b.posts_quantile
from b 
order by b.users_quantile

Enter Parameters

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