Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a set of data with a certain mean, variance, and standard deviation. I centered the mean around the origin the standard way by subtracting it from the data.

Now how do I modify the data to make variance = 1?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Just divide everything by the standard deviation.

Suppose first that you have a finite data set $x_1,x_2,x_3,\ldots,x_n$.

Let $\overline{x} = (x_1+\cdots+x_n)/n$ be the mean and $s=\sqrt{(1/n)\sum_{i=1}^n (x_i - \overline{x})^2}$ be the standard deviation. Let $y_i=x_i/s$, i.e. we're dividing everything by the standard deviation. Then $$ \overline{y} = \frac{y_1+\cdots+y_n}{n} = \frac{\frac{x_1}{s}+ \cdots+\frac{x_n}{s}}{n} = \frac 1 s \cdot \frac{x_1+\cdots+x_n}{n} = \frac{\overline{x}}{s}. $$ And the standard deviation of the $y$-values is $$ \sqrt{\frac 1 n ((y_1-\overline{y})^2 + \cdots+(y_n-\overline{y})^2)} = \sqrt{\frac 1 n \left( \left(\frac{x_1}{s}-\frac{\overline{x}}{s}\right)^2+ \cdots + \left(\frac{x_n}{s}-\frac{\overline{x}}{s}\right)^2\right)} $$ $$ = \frac{1}{\sqrt{s^2}}\sqrt{\frac 1 n ((x_1-\overline{x})^2 + \cdots+(x_n-\overline{x})^2)} = \frac 1 s \cdot s = 1. $$

For discrete data sets with non-uniform distributions, including infinite discrete data sets, one replaces $1/n$ with appropriate weights $p_i$. For continuous data sets, one used integrals, but the argument is essentially the same.

share|improve this answer
    
I knew that it would be something trivial like this. Can you show why this works? –  flapjackery May 21 '12 at 1:22
    
@flapjackery: Scaling the data by a value $a$ scales the standard deviation also by $a$, as you can see from the definition $\sigma = \sqrt{\frac1n\sum{x_i^2} - \big(\frac1n\sum x_i\big)^2}$. –  Rahul May 21 '12 at 1:48
    
@RahulNarain : That works if $a\ge 0$. In general multiplying everything by $a$ has the effect of multiplying the standard deviation by $|a|$. –  Michael Hardy May 21 '12 at 1:54
    
@MichaelHardy: You're right, of course. Thanks for the correction. –  Rahul May 21 '12 at 2:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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