At many question-and-answer sites, like StackExchange, people can upvote or downvote each answer. These sites also typically try to use the votes to sort answers, so the answers that are most likely to be helpful or accurate tend to appear nearest the top. Given the number of upvotes and downvotes for each answer, how should one sort the answers?

Examples. To illustrate why I think this question might have some non-trivial statistical content, let me survey a handful of methods one might consider and some shortcomings of them. In each method, we compute a score for each answer from its upvotes and downvotes, and then sort the answers by score, so the only question is what method to use to compute the score.

• Upvotes divided by total number of votes. This estimates the fraction of voters who held a positive opinion of the answer, which is arguably natural and meaningful in its own right. Limitations. Is an answer with 1 upvote and 0 downvotes really better than an answer with 8 upvotes and 1 downvotes?

• Compute a confidence interval. I suppose we could compute, for each answer, a confidence interval for the true fraction of people who would vote positively if they voted. But it is not clear how to extend this to a complete sorting scheme; what do we do when two answers have overlapping confidence intervals?

• Laplace smoothing. We could apply Laplace smoothing (additive smoothing) to the counts of upvotes and downvotes, then estimate the fraction of votes that are positive. If we have $u$ upvotes and $d$ downvotes for an answer, its score will be $(u+1)/(u+d+2)$. (For instance, this would declare that an answer with 3 upvotes and 1 downvote is equivalent an answer with 1 upvote and 0 downvotes. Does that seem reasonable? Hard to say.)

• It should be noted, that in this particular site, downvotes are a bit rare. Apr 20, 2012 at 16:31
• @mpiktas, OK. I'm most interested in the general question, as downvotes are more common at some sites than others. But if you have a good answer that is specialized to the case where downvotes are rare, that'd be great, too.
– D.W.
Apr 25, 2012 at 0:36

The scheme apparently works like this. The naive uncorrected rating for an answer is $r = u/n$, where $u$ is the number of upvotes and $n$ the total number of votes for that answer (i.e., $n=u+d$, where $d$ is the number of downvotes). Let $r^*$ denote the average uncorrected rating, averaged over all answers, i.e., the average of $r$ over all answers. Also, let $n^*$ the average number of votes per answer, over all answers, i.e., the average value of $n$.
With these definitions, the Bayesian rating for an answer is $r'$, defined as follows: $$r' = \frac{n}{n+n^*} r + \frac{n^*}{n+n^*} r^*.$$ Notice how if we have no votes on this answer, then $r'=r^*$ (the Bayesian rating is the average rating across all answers); whereas as $n \to \infty$, we have $r' \to r$ (the Bayesian rating for an answer converges to the naive uncorrected rating, as the number of votes on the answer becomes large). These seem like appealing properties.