Skip to content
Prev 31112 / 398506 Next

Missing Value And cor() function

On Thu, 24 Apr 2003 12:27:50 +0200
vincent.stoliaroff at socgen.com wrote:

            
Even though using pairwise deletion of NAs will result sometimes in a singular correlation matrix, it is better to do that than to replace NAs with constants, which will distort the correlations.

You may want to look at the rcorr function in the Hmisc package, which does pairwise deletion of NAs for Pearson and Spearman correlations.  See http://hesweb1.med.virginia.edu/biostat/s/Hmisc.html
Please do not include such long disclaimers in your messages.

---
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat