1.0.0 • Published 9 years ago

wilson-score v1.0.0

Weekly downloads
24
License
MIT
Repository
github
Last release
9 years ago

Wilson Score Build Status

Calculates the lower bound of the binomial proportion confidence interval as calculated by the Wilson score interval. If you're not retarded, you would use this score instead of averages when sorting and ranking (doesn't matter what the user sees). This is what reddit uses for "best".

API

var wilson = require('wilson-score')

wilson(up, total , z-score)

  • up - the total number of "yes"s
  • total - the total number of votes
  • z-score - the z-score of the interval. By default, it's ~2.3 which corresponds to a 99% confidence interval. Use 1.644853 for 95%.

Instead of calculating the average as up / total, calculate the wilson score via wilson(up, total). The wilson score will always be lower than the average.