$$ \begin{align} n & = \text{number of reviews}\\ x & = \text{review score}\\ \bar{x} & = \text{aggregate score} \end{align} $$
I have a specified number of reviews for a product, I have the review scores themselves, and I want to calculate the average.
$$\frac{x_1 + x_2 + x_3 + \dots + x_n}{n} = \bar{x}$$
This is how I would find the average/aggregate score given all of the individual review scores. What if I have incomplete data. Say I only know the number of reviews ($n$), the latest review ($x$), could I calculate the aggregate accurately provided only those two bits of information?
$$\frac{\bar{x}_\text{old} \cdot n_\text{old} + x}{n_\text{new}} = \bar{x}_\text{new}$$
Is this right? Sorry I'm not sure how best to articulate my question. I'm trying to implement a review scoring system for my business website and instead of keeping SQL records of every single review ever made, I'd like to save space/query time and just keep track of $n$ and $\bar{x}$.
For example:
Review Scores = 4, 2, 5, 3, 6, 7
Number of Reviews = 6
Average = 4.5
If a new review with a score of 5 happens, the average using the first equation yields $4.571$, but I don't want to keep record of every review. Using the second formula gives $4.571$ as well, but I'm working with small $n$; is this method accurate beyond as well?
tl;dr:
$$\frac{\frac{x_1+x_2+x_3+\dots+x_n}{n} \cdot n+x_{n+1}}{n+1} = \frac{x_1+x_2+x_3+\dots+x_n+x_{n+1}}{n+1} = \bar{x} ?$$
Your "updating" formula is correct. You do not need to know every value to know the average, all you need is the sum of scores and the number of scores. Your formula is effectively "recovering" the previous sum, adding in the new result, and re-averaging with one higher number of scores.
A more compact version might be:
$\bar x_{n} = \frac{\bar x_{n-1}(n-1)+x_n}{n}$ Now you really only need to know the total number of reviews, the previous average score and the current review score.