R语言自主编写相关检验函数(pearson、spearman、kendall)
相关检验的函数有三种,我们尝试自己编写一下cor(x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman"))x<-c(40,42,50,55,65,78,84,100,116,125,130,140)y<-c(130,150,155,140,150,154,165,170,167,180,175,185)## pearson系数cor(x,y,method = "pearson"
复制链接