Calculate average for 5 star review system based on average and quantity of reviews I also asked this on math.stackexchange.com but they said should better ask my question in this section.
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 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.
I allready found something like this based on the bayesian average, is this Something that I should use?
$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;

If anyone could help me out that would be great.
 A: In a comment you say

I just need an average so that in the example Company B will rank
above Company A when creating a Top 10 or Something like that.

So, if that is the goal, you can use the number of reviews to calculate a standard error of the mean (arithmetic mean) of the ratings. Using a normal distribution as an approximation, you can choose the top ten as the ten companies which are most probable to be highest ranked. A practical (and fast) way to implement that could be a simulation.  Simulate say 1000 times, and choose the ten companies that most often are in the top ten. It might be better to rank-order the ratings in each simu iteration, and use the average rankings. That way the result does not depend on the number ten.
Focus now on two companies with the same high mean but different standard errors (caused by different number of reviews). Now the company with the smallest standard error will have a higher chance to be on the top ten, since for  these the downside does most damage. For two companies with the same low mean, the conclusion is the opposite.
If you still want a formula, not only simulations, think bayes. Use shrinkage methods, and shrink towards the global mean. Search this site, and maybe have a look here.
