# Covariance between random variables with missing data

I'm not sure if this is possible, but I'm wondering if there is a way to determine/estimate the covariance between random variables where there is always missing data in one variable when another variable has a value. Hopefully an example will make this clear:

Suppose I want to test a material for its strength properties. I can perform a tensile test to test its tensile strength or a compression test to test its compressive strength, but never both since each test will destroy the sample. So may data may look like:

$$X = [x_1, \text{NA}, x_3, \text{NA}, \text{NA}, x_4, \ldots] \\ Y = [\text{NA}, y_2, \text{NA}, y_4, y_5, \text{NA}, \ldots]$$

Note that there is no bias in choosing what test is run; it is just as likely high tensile strength tests will be missed as low tensile strength tests.

Is there a meaningful way to find the covariance between these variables? Is multiple imputation something that would help?

Not with just this information you can't. You can easily have perfect negative correlation or perfect positive correlation or anything in between and yet have it be entirely consistent with the information you give.

Consider this:

 x 14.2 NA  10.8  NA   NA   7.2  NA  9.1
y  NA 12.1  NA   9.8 11.3  NA  8.9  NA


If we fill it out this way:

 x 14.2 12.1 10.8  9.8 11.3  7.2  8.9  9.1
y 14.2 12.1 10.8  9.8 11.3  7.2  8.9  9.1


the correlation is 1. But if we do it this way:

 x 14.2  7.9 10.8 10.2  8.7  7.2 11.1  9.1
y  5.8 12.1  9.2  9.8 11.3 12.8  8.9 10.9


then the correlation is -1. But then if we do it this way:

 x 14.2  6.9 10.8  8.5  7.1  7.2  6.9  9.1
y 10.2 12.1  8.5  9.8 11.3  6.7  8.9 12.3


then the correlation is 0 (to better than the 2-3 figure accuracy we are working with).

You can have any correlation you want!

• What if each variable individually follows some univariate distribution? Then we can say that some possible values for the missing data are more likely than others and we aren't as free to make the correlation anything we want. My thought is that you can try imputations: draw from the individual univariate distributions to fill in the NA values, compute the correlation and repeat. You could then look at the resulting distribution of correlations to get an estimate. – pmat Aug 24 '17 at 2:16
• Search our site for copula or copulas. You can make the marginal distributions any continuous distribution you like without any harm to say a Spearman or Kendall correlation, but naturally some choices of population margins could make one or other of the extreme Pearson sample correlations unlikely / difficult. You might have two monotonically related variables but where the population relationship is distinctly curved, making a sample linear correlation of -1 or +1 tricky. However even pretty extreme margins (ones that are rare in practice) may not push you all that much -- ... ctd – Glen_b Aug 24 '17 at 2:36
• ctd... e.g. if your population Pearson correlation is restricted to between -0.5 and +1 does that really help you infer the observations very well? I'd say that's almost no help at all, even though it rules out some of the extreme cases of correlation. – Glen_b Aug 24 '17 at 2:42
• pmat, I have tried multiple imputations in the case where the missing values corresponded to censored data (nondetects in chemical measurements) and found the resulting covariance matrix estimates to be systematically biased. (See stats.stackexchange.com/questions/1781 for my original question. Some of the answers might suggest approaches for your case.) – whuber Aug 24 '17 at 14:37