Is there any way to perform bivariate regression using pairwise deletion of missing values in R? na.action options in lm() do not offer such a possibility – the default na.action is na.omit, which is equivalent to listwise deletion. I already tried estimating the covariance matrix using pairwise deletion and then use the function mat.regress (package psych) with the pairwise covariance matrix. However, mat.regress is a function to compute multiple regression (not bivariate). Thank you.

  • 2
    $\begingroup$ This question appears to be off-topic because it is about how to use r. $\endgroup$ Jun 27 '14 at 12:05
  • $\begingroup$ I think this question should stay here. It is a pretty simple chore to answer this question without regard to statistical programming. $\endgroup$
    – Andy W
    Jun 27 '14 at 12:19

When you use pair wise deletion to estimate a covariance matrix it just means that for any pair of variables you use all available observations that are not missing on either covariate.

So if you had a data matrix

#| A  B  C
1| 1  1  NA
2| 2  NA 2
3| NA 3  3
4| 4  4  4

When calculating the covariance between columns A and B you would use rows (observations) 1 and 4, and when calculating the covariance between A and C you would only use rows 2 and 4.

So in the case of bivariate regression or simple linear regression, it is equivalent to list-wise deletion.

  • $\begingroup$ I think that when calculating the covariance between A and B, pairwise deletion would use rows 1, 2 and 4 to compute the mean of variable A and rows 1, 3 and 4 to calculate the mean of B. After that, pairwise deletion will use only rows 1 and 4 to calculate the covariance. However, the means used in the formula are based on three rows. What I mean is that pairwise deletion tries to use all available information in the data. In other words, when using pairwise deletion in bivariate regression, one may arrive at different results of coefficients than when they use listwise deletion. $\endgroup$
    – petrivan
    Jun 27 '14 at 12:50
  • $\begingroup$ You should not use the mean and variance calculated from all available cases. Try to see what happens in the example data set I provided when you do! $\endgroup$
    – Andy W
    Jun 27 '14 at 12:58
  • 1
    $\begingroup$ My point is that listwise and pairwise deletion methods lead to different results (based on the available literature, and also when I perform the bivariate regression in SPSS). I know that pairwise deletion has its drawbacks. However, I would just like to know if and how to perform pairwise deletion in R. $\endgroup$
    – petrivan
    Jun 27 '14 at 13:11
  • $\begingroup$ @petrivan - I'm not sure how SPSS does do it's pairwise deletion for linear regression. Here is how I thought they would do it with an R code example, but they are not the same. $\endgroup$
    – Andy W
    Jun 27 '14 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.