Anything with user-submitted ratings can be sorted by those ratings. But what is the best way? The naive approach is to sort by average rating. Unfortunately, this would rate 5-stars from a single user as higher than 4.5-stars from 150 users.
This guy has an answer. In short, his recommendation is to take the lower bound of the 95% confidence interval, given by:
[latex size=”3”]\frac{\hat{p}+\frac{z^2{\alpha/2}}{2n} \pm z{\alpha/2}\sqrt{(\hat{p}(1-\hat{p}) + z^2{\alpha/2}/{4n})/n}}{1+z^2{\alpha/2}/n}[/latex]
where
- [latex]\hat{p}[/latex] is the observed fraction of positive ratings
- [latex]z_{\alpha/2}[/latex] is the [latex]1-\alpha/2[/latex] quantile of the standard normal distribution
- [latex]n[/latex] is the total number of ratings
Or, in Ruby:
require 'statistics2'def cilowerbound(pos, n, power) if n == 0 return 0 end z = Statistics2.pnormaldist(1-power/2) phat = 1.0pos/n (phat + zz/(2n) - z * Math.sqrt((phat(1-phat)+zz/(4n))/n))/(1+z*z/n) end
where
- pos is the number of positive rating
- n is the total number of ratings
- power refers to the statistical power (0.05 recommended)
Author
William BallikDate
February 20, 2009Time
8:45 pmAuthor
William BallikDate
February 20, 2009Time
8:46 pmAuthor
Brendan RiberaDate
June 12, 2009Time
10:13 am