wilson-score

1.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i wilson-score

Weekly Downloads

15

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jongleberry