110

A silly question occurred to me. I was wondering if there were any way to know what number is the median reputation level here on Stack Overflow.

Just to clarify, I'm not looking for the mean reputation but for the median reputation. That is to say the threshold where there are as many users below as users who are above.

I thought of giving SE Data Explorer a try but I'm totally unfamiliar with it. Therefore, besides the actual number, I'm also interested in how it can be retrieved so I can make my future own queries.

14
  • 142
    I'd be pretty shocked if it was anything other than 1.
    – Servy
    Commented Jun 15, 2015 at 15:38
  • 4
    You should also consider if users are active or not in the question as I would wager there are a lot of low rep users who are not active and where never very active at all.
    – Joe W
    Commented Jun 15, 2015 at 15:39
  • Maybe it would be relevant not to include 1-rep users in the query then.
    – D4V1D
    Commented Jun 15, 2015 at 15:39
  • 2
    Why would it be more relevant to include 2-rep users? Commented Jun 15, 2015 at 15:40
  • 1
    I guess 2-rep users have been participating at least once in SO where 1-rep users have just subscribed.
    – D4V1D
    Commented Jun 15, 2015 at 15:40
  • 13
    1-rep users also includes people who have lost more rep then gained.
    – Joe W
    Commented Jun 15, 2015 at 15:42
  • 43
    The 1 rep users start listing at page ~42000. Page 21000 lists the median, it is 21. Commented Jun 15, 2015 at 15:46
  • 20
    SELECT MAX(Reputation) FROM (SELECT TOP 50 percent Reputation FROM Users ORDER BY Reputation) as halfbyrep says it is 1. Add a WHERE clause to narrow down the selection of what users 'count'.
    – Martijn Pieters Mod
    Commented Jun 15, 2015 at 15:48
  • 17
    Interesting question! I don't think that the median will tell you much, but I'd be interested to see if a frequency distribution chart (or even a histogram) showed distinct 'peaks' or a 'mode' other than 1. Most social sites will show a peak of '1's (people who wandered in once and found nothing to draw them back), a broad population of users with a Gaussian (or a Poisson) profile, and a far-out peak of obsessive geeks with an upper bound constrained by the number of minutes in the day and a disturbing willingness to push the known human limitations of eating sleeping and personal hygiene. Commented Jun 16, 2015 at 17:59
  • 2
    @Nile I'd like to see that histogram Commented Jun 17, 2015 at 0:23
  • 4
    @Nile, I very much doubt that the 'obsessive geeks' form a peak. Obsessive geekiness is a spectrum and there should be plenty of intermediate geeks to smooth out the distribution.
    – jwg
    Commented Jun 17, 2015 at 6:52
  • Is it possible to GROUP BY year(user.CreationDate) or by user.LastAccessDate to see if any intrayear trends pop up?
    – John Mee
    Commented Jun 17, 2015 at 7:27
  • Given that users are signing up all the time, and many are not active, it's very likely that the median is and will always be one. Commented Jun 17, 2015 at 22:04
  • 3
    loosely related: Distribution of Reputation on Stack Overflow
    – Tanner
    Commented Jun 18, 2015 at 12:56

4 Answers 4

131
  1. Go to the users > reputation > all page
  2. Look at the last page in the list of pages. Divide that value by two
  3. Go to that page by editing the query string parameter for the page number. (At the time of this posting, this is the appropriate page.)
  4. If the users on that page don't all have the same reputation (at the time of this post, they do all have the same reputation) compute the median rep of the users on that page.

At the time of this post, the median rep is 1.

16
  • 3
    Fair enough. Thanks for answering. Wouldn't it be any way to prevent the inactive users from being added in the calculation of the median rep?
    – D4V1D
    Commented Jun 15, 2015 at 15:44
  • 10
    @D4V1D How do you define "active"?
    – Servy
    Commented Jun 15, 2015 at 15:46
  • 2
    I'd give a try in guessing that we are talking about users who have at least asked one question or one answer. Just a thought.
    – D4V1D
    Commented Jun 15, 2015 at 15:47
  • 9
    @D4V1D There are people with hundreds of thousands of rep that have never asked a single question.
    – Servy
    Commented Jun 15, 2015 at 15:47
  • Users who have interacted with the site somehow? (edited my comment above).
    – D4V1D
    Commented Jun 15, 2015 at 15:48
  • 2
    @D4V1D At one point one of the 300K+ rep users had not been seen here for over 4 years. Is that active? Should that user be counted (IIRC he visited after that, but there will be others).
    – Anthon
    Commented Jun 15, 2015 at 15:49
  • 1
    @D4V1D Does registering an account count as interaction, if so, that won't filter out anyone. Also keep in mind none of the extracts will include deleted posts, so you won't see any actions for a user that asked one question and had it deleted.
    – Servy
    Commented Jun 15, 2015 at 15:50
  • 3
    Might be interesting to see for users with at least 10 non deleted questions + answers.
    – Joe W
    Commented Jun 15, 2015 at 16:14
  • @Servy I would have to say that registration doesn't count as interaction. I get that deleted posts won't be included. So, we can miss a certain number of accounts but we thusly could get a more accurate number that if all accounts were included. This would not be related to the last connection date though.
    – D4V1D
    Commented Jun 15, 2015 at 18:34
  • 7
    I would just exclude users with a message containing "please kindly". Commented Jun 16, 2015 at 4:03
  • 12
    Why not just exclude everyone with a rep of exactly 1? We already know there are a lot of them.
    – Kevin
    Commented Jun 16, 2015 at 4:10
  • 1
    @Kevin See Hans Passant's and Becuzz comments.
    – D4V1D
    Commented Jun 16, 2015 at 9:44
  • 1
    is it possible to only include those who had a reputation change within the last 3 months? Commented Jun 16, 2015 at 16:46
  • 2
    RE: Users with interactions. Basically any user interaction for a new user is going to cause a bronze badge. Just look for users with at least one badge. Even with 1 reputation, if they have a badge, they have interacted somewhere.
    – Travis J
    Commented Jun 16, 2015 at 20:13
  • 8
    @onebree That's because, by definition, you only see the users who are interacting with the site (unless you go searching through random user profiles.)
    – reirab
    Commented Jun 17, 2015 at 2:41
61

After looking at rene's answer, I ran my own query filtering out anyone with 1 rep and got an answer of 21. For anyone interested the query is thus:

select avg(reputation) median from
(select reputation, 
rnasc = row_number() over(order by reputation),
rndesc = row_number() over(order by reputation desc)
 from [users]
 where reputation > 1
) b
where rnasc between rndesc - 1 and rndesc + 1
10
  • 13
    It's still 21, if you exclude users with 101 reputation (site association bonus only). Commented Jun 16, 2015 at 17:23
  • Thanks for that! I'll leave the check mark on Servy's answer though as it's this very one that made me find 21 (1-rep excluded) median reputation :) @ChristianStrempfer Interesting, although I'm quite sure there are other ways to reach 101 rep rather than subscribe + site association bonus only so you it's not 100% accurate.
    – D4V1D
    Commented Jun 16, 2015 at 18:10
  • @D4V1D aren't the chances of the latter (bonuses) leading to that reputation high enough compared to the former, that it would be less erroneous overall to exclude 101?
    – xyz
    Commented Jun 17, 2015 at 2:45
  • @prakharsingh95 Sorry, as English is not my primary language, I didn't get all of your comment. Could you rephrase it?
    – D4V1D
    Commented Jun 17, 2015 at 6:54
  • @D4V1D I was wondering that isn't the number of people with 101 reputation primarily those that get bonuses? You mention although I'm quite sure there are other ways to reach 101 rep but other than bonuses, it seems unlikely people get exactly 101 rep.
    – xyz
    Commented Jun 17, 2015 at 6:58
  • @prakharsingh95 I totally agree with you. 101-rep users are primarily those that get bonuses but it's not 100% accurate as, even though it seems unlikely people get exactly 101 rep, it's still possible to reach that threshold without having gotten the bonuses, just by upvotes / accepted answers / etc.
    – D4V1D
    Commented Jun 17, 2015 at 7:01
  • 3
    @D4V1D Exactly! Consider 10000 users with 101rep who got there by bonuese, and say 100 got there by upvotes (1%). So if you include all 101 rep users you include 10k erroneous entries, but if you exclude all 101 rep users you only discard 100 erroneous entries. I feel that the latter leads to lesser error.
    – xyz
    Commented Jun 17, 2015 at 7:07
  • @D4V1D: such a user should have 201 reputation: meta.stackoverflow.com/questions/285130/… Commented Jun 17, 2015 at 8:46
  • @prakharsingh95 I ran Becuzz's query after having added and reputation != 101 and the result is still 21.
    – D4V1D
    Commented Jun 17, 2015 at 8:58
  • 1
    Instead of filtering out reps of 1 and 101 which could include users with some activity, just filter out user who have never asked a question or answered one. I wouldn't care if a user left 1000 comments but never posted answer or question. Commented Jun 17, 2015 at 21:40
44

The existing posts answer your question perfectly, but for information, here is what the reputation distribution looks like. You can obtain the data with the following query:

SELECT Reputation AS reputation, COUNT(Reputation) AS distribution
FROM Users
GROUP BY Reputation
ORDER BY Reputation

But because Jon Skeet, logarithmic scales are mandatory in order to obtain a readable graphic. It's fairly easy with Matlab, for instance:

data = readtable('QueryResults.csv');
data.reputation = str2double(data.reputation);
data.distribution = str2double(data.distribution);

loglog(data.reputation, cumsum(data.distribution) / sum(data.distribution));
title('Cumulative reputation distribution');
xlabel('Reputation');
ylabel('Normalized cumulative distribution');

Cumulative reputation distribution

Notice that people with 1 rep represent almost 61% of the Stack Overflow members, hence your answer: the median rep is 1.

6
  • 1
    great answer, it helped Commented Jun 17, 2015 at 10:21
  • 6
    I love how Jon Skeet makes the whole distribution skewed and you had to apply a logarithmic scale lol. +1.
    – rayryeng
    Commented Jun 17, 2015 at 21:42
  • 6
    A very trivial note: The "X: 1" tooltip blocks the "1" in 10^0. I was confused why there is 0^0 on the graph.
    – Andrew T.
    Commented Jun 18, 2015 at 2:04
  • 1
    It's interesting that there's a slight hiccup in the curve after a rep of around 100. Perhaps that's due to people gaining the 100 rep cross-site bonus when making their first SO post after posting on other SE sites but then not making many more after that. It might also be related to something that happens after making 200 rep, when members start to get ranked. I can't think what though.
    – samgak
    Commented Jun 18, 2015 at 12:53
  • 2
    @samgak I think it's between 200 and 300, which is because of people earning the association bonus after having gained 200 rep on SO, so jumping from 200 to 300.
    – fhdrsdg
    Commented Jun 18, 2015 at 13:10
  • 2
    @samgak You can actually also see a little jump from 100 to 101, which is due to the 12k users with 101 rep, of which most probably got to 200 rep on another site and got the association bonus on SO.
    – fhdrsdg
    Commented Jun 18, 2015 at 13:21
43

It is 1 based on this SEDE query

-- http://stackoverflow.com/a/7227860/578411
select avg(reputation) median from
(select reputation, 
rnasc = row_number() over(order by reputation),
rndesc = row_number() over(order by reputation desc)
 from [users] 
) b
where rnasc between rndesc - 1 and rndesc + 1

... which is a big lie. The actual median is...

92

As indicated by @Dronehinge the users that really should have been deleted shouldn't be part of the population.

Those registered user deletion rules are:

  1. The user has not visited Stack Overflow in six months
  2. The user has only 1 reputation,
  3. no visible posts,
  4. and no other accounts on the network

The last requirement turns the new version of the query into a multi-database beast, with temp tables and database cursors:

-- all databases
declare  db_c cursor for select [name] 
                         from sys.databases 
                         where database_id > 5 -- skip master, temp, model, msdb, Data.SE
                         and database_id <> db_id() -- skip current db as well
                     
declare @db_c_name sysname   -- holds name of db after fetch
declare @sql nvarchar(max) -- holds build up sql string

-- result table
create table #all_accounts ( accountid int)

-- create a union of all accountid's across
-- all databases
set @sql = N'insert into #all_accounts '                            
open db_c
fetch next from db_c into @db_c_name
while(@@FETCH_STATUS = 0)
begin
    set @sql = @sql + N'select accountid from ' + QUOTENAME(@db_c_name) + N'.dbo.users'
              
   fetch next from db_c into @db_c_name
   IF (@@FETCH_STATUS = 0) 
   BEGIN   
     set @sql = @sql + N' 
     union 
     '
   END
end
close db_c
deallocate db_c

print @sql
exec(@sql) -- execute the insert with the unions

-- http://stackoverflow.com/a/7227860/578411
select avg(reputation) median from
(select u.reputation, 
rnasc = row_number() over(order by u.reputation),
rndesc = row_number() over(order by u.reputation desc)
 from [users] u
 -- https://meta.stackexchange.com/questions/146450/delete-old-unloved-users/146452#146452
 where u.lastaccessdate > dateadd(m, -6, getdate()) -- active in last 6 months ago
 and u.reputation > 1 -- more then 1 rep 
 and exists (select 1 from posts where owneruserid = u.id) -- visible post
 and exists (select 1 from #all_accounts where accountid = u.accountid)  --other accounts in the network
) b
where rnasc between rndesc - 1 and rndesc + 1

select count(*)
from #all_accounts

select count(*)
from users

select count(*)
from users u
left outer join #all_accounts acc on acc.accountid = u.accountid
 where acc.accountid is null

drop table #all_accounts
12
  • 6
    I wonder what it is if you remove all the like One Million users that should have been auto-deleted by the system but have not b.c of the ridiculous throttle.
    – CRABOLO
    Commented Jun 15, 2015 at 18:08
  • 8
    Interestingly, I ran it and filtered out all the 1 rep users and the answer it gave me was 21. Still not very high.
    – Becuzz
    Commented Jun 15, 2015 at 18:37
  • 1
    @Becuzz If I were you, I'd post that query. It's more useful in my opinion.
    – mason
    Commented Jun 16, 2015 at 16:33
  • @mason I posted it if you are interested.
    – Becuzz
    Commented Jun 16, 2015 at 16:44
  • Instead of filtering out reps of 1 and 101 which could include users with some activity, just filter out user who have never asked a question or answered one. I wouldn't care if a user left 1000 comments but never posted answer or question. Commented Jun 17, 2015 at 21:41
  • 2
    @DaveAlperovich What about users who haven't asked or answered questions but have made edits? Commented Jun 18, 2015 at 13:39
  • 8
    You all don't realize how much I hate the practice from statisticians to change the rules if they don't like the outcome...
    – rene
    Commented Jun 18, 2015 at 14:34
  • 1
    If we change that to only one month, so we only have 'active' users, we get 121: data.stackexchange.com/stackoverflow/query/327445/…
    – AStopher
    Commented Jun 18, 2015 at 17:02
  • Well done, rene. Though now it looks sorta painful... Commented Jun 18, 2015 at 18:39
  • This should be the accepted answer
    – CRABOLO
    Commented Jun 19, 2015 at 0:45
  • 1
    1 year ½ after, this number has decreased and is now at 91.
    – Veve
    Commented Jan 12, 2017 at 14:33
  • Thank you. Idk how anyone could comment 1 with a straight face
    – 9 Guy
    Commented May 28, 2022 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .