Why does $V(\bar x_1 - \bar x_2) = \frac {\sigma_1^2}{n_1} + \frac {\sigma_2^2}{n_2}$? (Samples are independent)

I don't quite understand why this is the case. I'm new to stats and when I think variance, my mind immediately goes to $$S^2 = \frac {\sum(x_i - \bar x)^2}{n - 1}$$. Is there a rule that I'm ignorant of or is there a way to use this formula for two sample means and come up with $$\frac {\sigma_1^2}{n_1} + \frac {\sigma_2^2}{n_2}$$?

• What is the variance of $\bar X_1$ if the variance of $X_1$ is $\sigma^2_{X1}$? What is the variance of $-\bar X_2$ if the variance of $X_2$ is $\sigma^2_{X2}$? What is the variance of $Y+Z$ if $Y$ and $Z$ are independent and the variance of $Y$ is $\sigma^2_Y$ and the variance of $Z$ is $\sigma^2_Z$? Jan 14 at 23:11
• en.wikipedia.org/wiki/Variance#Basic_properties Jan 14 at 23:45

The first step is to 'distribute' the variance operator $$\mathbb{V}$$. When all samples are independent we can say

$$\mathbb{V}(\bar{X}_1 - \bar{X}_2) = \mathbb{V}(\bar{X}_1 ) + \mathbb{V}(\bar{X}_2).$$

The reason we add the variances is because it makes sense for the variance to increase as we add more observations. The more we add, the more 'randomness' we introduce. The variance also has the property that $$\mathbb{V}(aX) = a^2\mathbb{V}(X)$$, so in your case $$\mathbb{V}(-\bar{X}_2) = \mathbb{V}(\bar{X}_2)$$. See here for more details about the properties of the variance.

The second step is to 'expand' $$\mathbb{V}(\bar{X}_1)$$ and $$\mathbb{V}(\bar{X}_2)$$. In general

$$\bar{X}_i = \frac{1}{n_i}\sum_{j=1}^{n_i}X_{i,j}$$

and so

\begin{align} \mathbb{V}(\bar{X}_i) &= \mathbb{V}\bigg(\frac{1}{n_i}\sum_{j=1}^{n_i}X_{i,j}\bigg)\\ &= \frac{1}{n^2_i}\mathbb{V}\bigg(\sum_{j=1}^{n_i}X_{i,j}\bigg) &&\hspace{0.1cm} (\text{since } \mathbb{V}(aX) = a^2\mathbb{V}(X))\\ &= \frac{1}{n^2_i}\mathbb{V}(X_{i,1} + X_{i,2} + ... + X_{i,n_i})\\ &= \frac{1}{n^2_i}\big[\mathbb{V}(X_{i,1}) + \mathbb{V}(X_{i,2}) + ... + \mathbb{V}(X_{i,n_i}))\big] &&\hspace{0.1cm} (\text{since the samples are independent)} \end{align}

Now, if the data are from the same distribution with constant variance $$\sigma^2_i$$ then the variance of $$\bar{X}_i$$ becomes

$$\mathbb{V}(\bar{X}_i) = \frac{1}{n^2_i} \cdot n_i\sigma^2_i = \frac{\sigma^2_i}{n_i}.$$

Returning to the first step, this means that

$$\mathbb{V}(\bar{X}_1 - \bar{X}_2) = \frac{\sigma^2_1}{n_1} + \frac{\sigma^2_2}{n_2}.$$