Variance of the difference of two iid sample means Let $X_{1}, ..., X_{n}$ be random variables independent of $Y_{1}, ..., Y_{n}$, where both groups are iid with associated population means $\mu_{1}$ and $\mu_{2}$ and population variances $\sigma_{1}^{2}$ and $\sigma_{2}^{2}$, respectively.
Let $\bar{X}$ and $\bar{Y}$ be their sample means.
What is the variance of $\bar{X} - \bar{Y}$?
Given what I understand about the properties of variances and means, I have arrived at $(1/n^{2})Var(nX-nY)$, but I am not sure how to proceed from this point.
I am aware of the variance property $Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y)$, but I am not sure how to relate a subtraction of two random variables to this situation. Is it as simple as affixing a negative sign to the entire equation?
 A: The sample average $\bar X$ has expected value $\mu_1$ and variance $\sigma^2_1/n$. By the same token, $\bar Y$ has expected value $\mu_2$ and variance $\sigma^2_2/n$. Now using the linearity of expectation we have
\begin{align*}
\text{var}(\bar X-\bar Y) & = E\left\{[(\bar X-\bar Y) - E(\bar X-\bar Y)]^2\right\}\\
&= E\left\{[\bar X - E(\bar X) - (\bar Y - E(\bar Y))]^2\right\}\\
&= E\left[(\bar X - E(\bar X))^2 -2(\bar X - E(\bar X))(\bar Y - E(\bar Y)) + (\bar Y - E(\bar Y))^2\right]\\
&= E\left[(\bar X - E(\bar X))^2\right] - 2E[(\bar X - E(\bar X))(\bar Y - E(\bar Y))]+E\left[(\bar Y - E(\bar Y))^2\right]\\
&= \operatorname{var}(\bar X) - 2\operatorname{cov}(\bar X, \bar Y) + \operatorname{var}(\bar Y)\\
&= \left(\sigma_1^2+\sigma_2^2\right)/n - 2\operatorname{cov}(\bar X, \bar Y).
\end{align*}
Using the fact that $X_i, Y_j$ are independent and some algebra can you now deduce that $\text{cov}(\bar Y, \bar X) = 0$?
A: As you note, $Var(X + Y) = Var(X) + Var(Y) + 2 Cov(X, Y)$. The variance of the difference of two means just involves a negative covariance term, namely $Var(X - Y) = Var(X) + Var(Y) - 2 Cov(X, Y)$.
