系统发育相关性检验

时间:2017-08-22 12:39:35

标签: r correlation phylogeny

我需要在两个变量之间进行相关性检验(返回r,t和p.value),这两个变量可以解释个体之间的系统发育相关结构。在R中有没有简单的方法呢?

1 个答案:

答案 0 :(得分:1)

来自ape包,特别是?ape::pic("系统发育独立对比"):

 library(ape)
 cat("((((Homo:0.21,Pongo:0.21):0.28,",
        "Macaca:0.49):0.13,Ateles:0.62):0.38,Galago:1.00);",
        file = "ex.tre", sep = "\n")
 tree.primates <- read.tree("ex.tre")
 X <- c(4.09434, 3.61092, 2.37024, 2.02815, -1.46968)
 Y <- c(4.74493, 3.33220, 3.36730, 2.89037, 2.30259)
 names(X) <- names(Y) <- c("Homo", "Pongo", "Macaca", "Ateles", "Galago")
 pic.X <- pic(X, tree.primates)
 pic.Y <- pic(Y, tree.primates)
 cor.test(pic.X, pic.Y)

 # Pearson's product-moment correlation
 # 
 # data:  pic.X and pic.Y
 # t = -0.85623, df = 2, p-value = 0.4821
 # alternative hypothesis: true correlation is not equal to 0
 # 95 percent confidence interval:
 # -0.9874751  0.8823934
 # sample estimates:
 # cor 
 # -0.5179156 

如果您要完成大部分工作,可能需要获得Paradis Analysis of Phylogenetics and Evolution with R,并查看phylogenetics task view