1
$\begingroup$

I am currently inserting a star rating of various vendors using the following formula New

New Rating Value = ((Overall Rating * Total Rating) + New Calculated ) / Total Rating

where

   Overall Rating = Current Rating value
    Total Rating   = No of reviews (ratings) currently present
    New Calculated = The new star rating value the user specified

The above formula works for adding a new rating. My question is how would I remove a specific rating and return to the old value if I only have the New Calculated and the total Rating value (I wont have access to the earlier Overall Rating ?

$\endgroup$
  • 1
    $\begingroup$ I think you want to ask this question on stackoverflow $\endgroup$ – saulspatz Jun 29 '18 at 23:32
1
$\begingroup$

If I understand correctly you have $$\frac {O\times T+N_c}T=N_r$$ yes?

Then, if you are given $N_r,N_c,T$ we get $$O=\frac {N_rT-N_c}T$$

Note: I am not entirely clear on the definition of $T=$ Total Rating. How is it the same even after you add a new rating? Shouldn't it have increased by $1$? Usually when you add a new element to a sample and seek to compute the new average given the old, you take into account that the sample size has increased by $1$.

$\endgroup$
  • $\begingroup$ The Total Rating is the no. of reviews. If we are removing a rating T would be T-1 $\endgroup$ – Rajeshwar Jun 29 '18 at 23:39
  • $\begingroup$ What is Nr ? is it New rating ? How would i get the New Rating ? New rating is the value which we replaced when we added a new rating $\endgroup$ – Rajeshwar Jun 29 '18 at 23:40
  • $\begingroup$ $N_r$ is what you call New Rating Value. If you don't have that (or some equivalent information) then you can't extract the old rating My point is that, in your formula, I think the denominator ought to be $T+1$. $\endgroup$ – lulu Jun 29 '18 at 23:41
  • $\begingroup$ When adding a rating T=T+1 and when removing a rating T=T-1 $\endgroup$ – Rajeshwar Jun 29 '18 at 23:42
  • $\begingroup$ yes you are correct $\endgroup$ – Rajeshwar Jun 29 '18 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.