首页 > 解决方案 > r cor spearman 处理缺失值

问题描述

我想计算非正态分布的变量之间的相关性,所以我将使用 Spearman。有一些缺失值,我不知道如何处理它们。在有关 Spearman 的 cor 函数中,它说:

"In the case of missing values, the ranks are calculated depending on the value of use, either based on complete observations, or based on pairwise completeness with reranking for each pair."

它还说:

"For cov and var, "pairwise.complete.obs" only works with the "pearson" method."

那么如何将“或基于对每对的重新排序的成对完整性”作为“使用”的标准呢?

cor(df, method="spearman", use= WHAT?) :)

标签: r

解决方案


推荐阅读