# Is covariance between two dummy variables zero?

Here is a problem I am facing: I need to test a hypothesis (t test), the formula for which is $t = \frac{\hat{B_1} - \hat{B_2}}{se(\hat{B_1} -\hat{B_2})}$

Now, we know that the bottom isnt actually that simple, and more like

$se(\hat{B_1} -\hat{B_2}) = \sqrt{se({\hat{B_1})^{2} + se(\hat{B_2})^{2}} - 2cov(\hat{B_1},\hat{B_2})}$

Since $cov(x,y)=E[(x-E[x])(y-E[y])]$ , isnt covariance between two dummy variables zero? (x,y are dummies)

I assume that they are independent of each other i.e. $E[XY]=E[X]E[Y]$, which seems like a reasonable assumption.

• Independence is a strong assumption, and is not always reasonable. If you are assuming that all dummies are independent, you're wrong. Otherwise, it's unclear why do you think that independence is a reasonable assumption since we don't know what are the dummies. Dec 29, 2014 at 20:59
• I'd say that's only a reasonable assumption if the dummies are factors built to be independent based on experimental design. If you did not design them to be independent (and check that they remain independent after data collection) then there is a chance that they are completely independent, but you better test that before making the assumption. Dec 29, 2014 at 21:28
• The covariance of the parameter estimates depends on the pattern of 0's and 1's in the dummies. It's not a matter of whether it seems like it would be "reasonable" -- you can simply calculate if it's the case. Dec 29, 2014 at 22:05
• Are you asking about regression coefficients on dummy variables, or dummy variables themselves? Everyone seems confused on that point Dec 29, 2014 at 22:32

If the question is about the covariance between how the dummies are represented, then it depends. For example, if you have a categorical variable with three levels (L1 L2 L3), represented with 2 dummy variables L2 and L3, then there is no way the covariance between the constructed L2 and L3 variables is zero, as they certainly are not independent.
If you have two categorical variables (say Male/Female and Treated/Not Treated), then it's certainly possible that the dummy representation between them are independent with ~zero covariance, but not necessarily the case.
$X, Y$ independent $\Rightarrow cov(X,Y)=0$ regardless of the nature of random variables $X$ and $Y$. Since you're assuming independence, covariance is 0.
Now, to answer your question without the assumption that $X,Y$ are independent, the covariance between two dummy variables is not necessarily zero. Consider dummy variable $X$ and $Y=I_{\{X=0\}}$.