美文网首页
R:cor.test correlation

R:cor.test correlation

作者: 胡童远 | 来源:发表于2022-07-04 09:29 被阅读0次

输入

与一个变量相关

depth = 1:6
p = c()
cor = c()
for(i in 1:ncol(df_g3))
{
    res = cor.test(df_g3[,i], depth, method = c("pearson"))
    p = c(p, res$p.value)
    cor = c(cor, as.numeric(res$estimate))
}
out_g3 = data.frame(cazy=colnames(df_g3), p_raw=p, cor_value=cor)
out_g3_sig = out_g3[which(out_g3$p_raw<0.05),]

相关文章

网友评论

      本文标题:R:cor.test correlation

      本文链接:https://www.haomeiwen.com/subject/eqkcbrtx.html