by Automatt-2 · 16y ago · 0 comments
What I'm saying is that it will rise to the top because even though only 50% of the ratings are positive, it will have many many more positive ratings than the nearest next item. That 2nd item may have a much higher percentage of positive ratings, but a much lower number of total ratings.
require 'rubygems'
require 'statistics2'
def ci_lower_bound(pos, n, power)
if n == 0
return 0
end
z = Statistics2.pnormaldist(1-power/2)
phat = 1.0*pos/n
(phat + z*z/(2*n) - z * Math.sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n)
end
puts ci_lower_bound(60, 100, 0.10) # => 0.517809505446319
puts ci_lower_bound(500, 1000, 0.10) # => 0.474027691168875
puts ci_lower_bound(50, 100, 0.10) # => 0.418847795168265
The top ranked result has 60 positives out of 100, and beats 500 out of 1000 - almost 10 times as many positive votes.