I have a review system and I stumble over the fact that I want to make a fair ranking and not just the average. The average is allready calculated but when you are sorting on this average the results are not fair.
EXAMPLE:
Company A has an average score of 4.8 based on 5 reviews. Company B has an average score of 4.7 based on 43 reviews.
If you rank on average score Company A is above Company B in ranking but I think it ain't fair because it is a lot harder to get a 4.7 based on 43 reviews.
I want to create a number that is based on the average review score and the number of reviews that are submitted.
Maybe I am wrong here for asking this question but what is the best formula to create such an average and wich values do I need for creating this?
I am developing in PHP if this should be important for you to know.
If anyone could help me out that would be great.
EDIT Ok, so this shoud do the trick? If I add this data to the formula the ranking should be better and most important more fair?
$avg_num_votes = 3.852941176470588; // Average number of reviews that are written for all company's on the website
$avg_rating = 4.822222222; // Average rating for all company's that are on the website that have a review
$this_num_votes = 1; // Number of reviews that are written for this company
$this_rating = 5; // Average rating of this company
$bayesian_rating = ( ($avg_num_votes * $avg_rating) + ($this_num_votes * $this_rating) ) / ($avg_num_votes + $this_num_votes);
echo $bayesian_rating;