You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am comparing 2 correlation methods in R: corPlot and cor (from stats package). The results of the correlation coefficients between corPlot and cor are identical when in the cor function I use use = "pairwise.complete.obs".
However, when using use = "na.or.complete" in the cor function, the results are completely different in some cases. In the example below, the pair C1 and E4 have no missing values and yet the correlation coefficient using use = "na.or.complete" in cor function, is different from that delivered by corPlot.
Why does corPlot use the "pairwise.complete.obs" method, instead of other methods to take care of missing values?
Thanks for this question and the good example. The question is a good one and ultimately depends on the nature of the data being looked at. Originally it was thought that "pairwise.complete.obs" would be a sensible default. However, the function really ought to give the user the option of changing this important parameter. I can see there would be some situations where "pairwise.complete.obs" would not be appropriate and could be potentially misleading.
I will amend the function to explicitly pass on that argument and make it clearer what the default is. This would not take long and will appear on GitHub before a new release to CRAN...
Question
Hello, I am comparing 2 correlation methods in R:
corPlot
andcor
(fromstats
package). The results of the correlation coefficients betweencorPlot
andcor
are identical when in thecor
function I useuse = "pairwise.complete.obs"
.However, when using
use = "na.or.complete"
in thecor
function, the results are completely different in some cases. In the example below, the pair C1 and E4 have no missing values and yet the correlation coefficient usinguse = "na.or.complete"
incor
function, is different from that delivered by corPlot.Why does
corPlot
use the"pairwise.complete.obs"
method, instead of other methods to take care of missing values?Thank you very much.
Camilo Montes.
The text was updated successfully, but these errors were encountered: