# Formula to discard items by votes (Lower bound of Wilson score confidence interval)

I'm not a statician/mathematician, so please be gentle with me

This is a cross-post from Stack Overflow. I'm working with a site that lets the users create 'sections'. Each section have multiple items which are voted. The best ones are shown in the main page.

I found that a simplistic approach to rank would be bad idea. positive_votes - negative_votes will rank the recent ones with less votes higher (100%, two votes) than the older ones that have way more votes but lower percentage (93%, 300 votes). The average isn't a solution either. I found one article that explains these concepts, why they are a bad idea and how to fix it.

So I'm using the lower bound of Wilson score confidence interval for a Bernoulli parameter and it seems to be working just fine. However, I'd like to discard items that rank way too bad in that particular section.

I think I require two things:

• The minimum votes required to discard an item in each section
• The score's threshold that decides if an item will be discarded or not

It has to consider that while one section might have hundreds of items with thousands of votes, another might have less than 10 items with 50 or 60 votes, so while the minimum votes required for the popular one might be 100, it might be too high for the less popular ones.

In the original question, somebody suggested to use the same formula. However, it seems that the Ruby implementation is missing some parts: the alpha/2 is not present anywhere. Also, the original formula has a +/- sign, while the implementation has just a minus sign.

Thanks!

• Oh, thank! I had no idea there was a SE fully dedicated to it. – metrobalderas May 17 '11 at 1:07
• Note I suggested using the upper bound from the same formula. – Aniko May 17 '11 at 2:47
• @metrobalderas, the questions can be migrated between sites. I'll flag the questions, maybe moderators will be able to merge. – mpiktas May 17 '11 at 3:09
• @mp Reading over the SO version and the article it references makes it clear the question belongs here: I think we would have quite a few things to say about the idea of ranking data by means of LCLs! I do not believe that CV mods can migrate a question from another site, but if the SO mods migrate it here we can do the merge easily. It might be best for @metro to flag the SO question and request the merge. – whuber May 17 '11 at 5:18
• I've flagged. I'm sorry about the duplicates, but it also covers both topics. – metrobalderas May 17 '11 at 5:24

## 1 Answer

Perhaps you could extend the idea of using the lower bound of the confidence interval for sorting: you could throw away items that have a low upper bound. The items with only a few votes will have pretty high upper bounds; the lowest upper bounds will correspond to the lowest "quality" items.

• I'm sorry, I'm not mathematician. How can I determine this lower bound? Also, could you expand this low upper bound concept? It seems a little too much for me hehe. Thanks for your response. – metrobalderas May 16 '11 at 19:09
• The formula you linked to has a +/- in it. Using the - gives you the lower bound which you are using to sort the items if I understand you correctly. I am suggesting using the +, which gives you the upper bound of the interval, and throw away items that have a low value for it. – Aniko May 16 '11 at 19:37
• Uh, maybe I'm missing something, but yes, the original formula has a +/- sign, however the Ruby implementation only has a minus sign, and, with further examination, there's some other things missing from the original formula; for instance, the alpha/2 is not present in any form in the whole formula. – metrobalderas May 17 '11 at 1:07
• alpha is there, it is just called power for some reason. – Aniko May 17 '11 at 2:41
• The formula defines a confidence interval: it has two ends. One is obtained by using the + and one is by using the -. The lower end (the lower bound of your title) is obtained by using the -. – Aniko May 17 '11 at 2:43