Turn counts of 1- to 5-star reviews into an average rating with its spread and share of positive reviews, plus a Bayesian average that fairly ranks items with very different numbers of reviews.
Average = Σ (stars × count) ÷ total ratings
An average rating is the weighted mean of star ratings: each star level multiplied by how many people gave it, added up, and divided by the total number of ratings. It's the familiar "4.3 out of 5".
On its own it ignores how many ratings there are. One 5-star review gives a perfect 5.0, which tells you almost nothing. Ranking items by raw average pushes barely-reviewed items to the top.
A Bayesian average fixes this by starting every item at a typical rating and letting real reviews pull it away. Items with few reviews stay near the typical value; items with many reviews move to their own average.
The Bayesian average is a shrinkage estimator in the empirical-Bayes tradition (Efron & Morris, 1975). See Sources.
m is the typical rating across all items; C is how many "imaginary" ratings of m each item starts with.
Five glowing reviews could easily be friends of the seller or luck. Four hundred mostly happy customers are much stronger evidence. As A collects reviews, its Bayesian average will move towards its true level.
Items with the same raw average but different numbers of ratings (m = 3.8, C = 20).
| Raw average | Ratings | Bayesian average |
|---|---|---|
| 4.8 | 1 | 3.85 |
| 4.8 | 5 | 4 |
| 4.8 | 20 | 4.3 |
| 4.8 | 100 | 4.63 |
| 4.8 | 1,000 | 4.78 |
Multiply each star level by its number of reviews, add them up, and divide by the total number of reviews.
An average that starts from a typical value and moves towards the item’s own average as reviews accumulate.
Roughly the number of reviews at which you’d start trusting an item’s own average; a common choice is the typical number of reviews per item.
The average rating across all items in the category. It defaults to 3 here, the middle of the scale.
Ratings are often skewed towards 5 stars; the median isn’t pulled down by a few 1-star reviews.
This page is for 1 to 5 stars. For other scales, the same formulas apply with different weights.
Happy customers and incentivised reviews skew ratings upwards, so differences near the top matter more than they appear.
The lower bound of a confidence interval for the share of positive ratings is also widely used for ranking.
Related Tools
Effect size measure.
Information entropy.
Species diversity.
Categorical variability.
Intraclass correlation.
Smoothed trend line.