# Impact of unit conversion on the relationship between standard deviation and variance

What impact should unit conversion have on the relationship between standard deviation and variance?

For example, when the units are kilograms, the sd is 3.156 kg , and the variance is 9.96 kg which is the sd^2.

However, when we convert this to grams, the sd is 3,156 g (the equivalent of 3.156 kg) but the variance is 9,963,829 g (the equivalent of 9,963.829 kg).

What is the correct way of doing this? For reference, I am working with a dataset that has been converted to kg, but the original units are grams.

set.seed(1)
in_kg <- runif(10, 0, 10)
sd(in_kg)
var(in_kg)

in_grams <- in_kg*1000
sd(in_grams)
var(in_grams)


Output:

> sd(in_kg)
[1] 3.156553
> var(in_kg)
[1] 9.963829

> sd(in_grams)
[1] 3156.553
> var(in_grams)
[1] 9963829

• If the sd is in g, the variance is in g squared. If it is in kg the variance is in kg squared. The units get squared along with the numbers. Sure, in this case and many others the units are unusual and don't have a simple explanation, but that's just what it is mathematically and part of why using sd helps interpretation. Commented Aug 17, 2020 at 8:46

If your unit conversion can be written as an affine linear mapping like $$f(x) = mx + b$$ where $$m > 0$$ (e.g. grams to kilograms is given by $$f(x) = 1000x$$, Celsius to Fahrenheit is given by $$f(C) = 1.8C + 32$$), and if $$X$$ is a random variable with $$V(X) = \sigma_X^2$$, then the random variable $$Y = f(X)$$ will have \begin{align} V(Y) & = E[(Y - E(Y))^2] \\ & = E[(mX + b - E(mX + b))^2] \\ & = E[(mX + b - (mE(X) + b))^2] \\ & = E[(mX - mE(X))^2] \\ & = E[m^2(X - E(X))^2] \\ & = m^2 E[(X - E(X))^2] \\ & = m^2 V(X) \\ \end{align} and hence the standard deviations have the relation $$\text{Standard deviation of Y} = \sigma_Y = \sqrt{V(Y)} = \sqrt{m^2 V(X)} = |m|\sigma = m \sigma .$$ So the variance will scale like $$\sigma_Y^2 = m^2 \sigma_X^2$$ but the standard deviations will scale like $$\sigma_Y = m \sigma_X$$