TITLE: What is the purpose of subtracting the mean from data when standardizing?
QUESTION [22 upvotes]: What is the purpose of subtracting the mean from data when standardizing? 
and What is the purpose of dividing by the standard deviation?

REPLY [5 votes]: Another reason is accuracy.
When computing the variance,
if the mean is large,
much accuracy can be lost.
For example,
the formula for the variance is
$\dfrac{1}{n} \sum_{i=1}^n (x_i-\bar x)^2
$
(you can write $\dfrac1{n-1}$ 
instead of $\dfrac1{n}$
if it makes you feel better).
If the $x_i$ are all close,
even if their mean is large,
this will be quite small.
If you write this in the
mathematically equivalent form
$\left(\dfrac{1}{n} \sum_{i=1}^n x_i^2\right)
-\left(\dfrac{1}{n} \sum_{i=1}^n x_i \right)^2
$,
you will be subtracting
two large quantities
to get a small quantity.
This is the standard recipe
for catastrophic cancellation
and loss of accuracy.
By the way,
if you do a Google search for
"online mean and variance",
you get a number of useful links
including this one from Wikipedia:
http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.