画一个带统计检验的PcOA分析结果 (再进一步,配对比较)

共 4070字,需浏览 9分钟

 ·

2021-09-27 04:59



前期回顾


方差分析基本概念:方差分析中的“元”和“因素”是什么?


PERMANOVA原理解释:这个统计检验可用于判断PCA/PCoA等的分群效果是否显著!


实战1:画一个带统计检验的PCoA分析结果




在检验完某个因素对物种组成有显著影响后,如果关注该因素不同水平对物种的构成是否存在显著影响,就需要逐一对每两对水平进行检验了。


配对Adonis确定不同管理方式两两之间对物种组成差异的影响


adonis分析可以检验某个因素整体对物种组成差异的影响,但不能比较这个因素的多个水平之间两两是否差异显著,如Management中的BFHM两种方式是否对物种组成差异有显著影响?


这时就需要pairwise.adonis来进行配对检验了。


# devtools::install_github("pmartinezarbizu/pairwiseAdonis/pairwiseAdonis")
library(pairwiseAdonis)

# This is a wrapper function for multilevel pairwise comparison
# using adonis() from package 'vegan'.
# The function returns adjusted p-values using p.adjust().
dune.pairwise.adonis <- pairwise.adonis(x=dune, factors=dune.env$Management, sim.function = "vegdist",
sim.method = "bray",
p.adjust.m = "BH",
reduce = NULL,
perm = 999)

dune.pairwise.adonis

## pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
## 1 SF vs BF 1 0.4016624 2.514890 0.2643110 0.055 0.0825
## 2 SF vs HF 1 0.2828804 1.857489 0.1710790 0.117 0.1404
## 3 SF vs NM 1 0.7575728 3.425694 0.2551595 0.008 0.0480 .
## 4 BF vs HF 1 0.1617135 1.567531 0.2071390 0.197 0.1970
## 5 BF vs NM 1 0.5662456 2.715242 0.2794827 0.017 0.0510
## 6 HF vs NM 1 0.6513088 3.423068 0.2755413 0.031 0.0620

拼一起画个图


library(ggpubr)
library(patchwork)
tab2 <- ggtexttable(dune.pairwise.adonis[,c("pairs","R2","p.value","p.adjusted")], rows = NULL,
theme = ttheme("blank")) %>%
tab_add_hline(at.row = 1:2, row.side = "top", linewidth = 1) %>%
tab_add_hline(at.row = nrow(dune.pairwise.adonis)+1, row.side = "bottom", linewidth = 1)

p2 = p + tab2
p2






p2 + plot_layout(design=c(area(1,1), area(2,1)))
# p / tab2
# 调布局


ANOSIMPERMANOVA的pairwise analysis声明:“Pairwise tests are not possible in vegan. My understanding is that the non-R software with such tests makes separate pairwise tests using subsets of data with only two levels of a factor in one test. We don’t provide that in vegan and have no plans to provide this in the future.”  (cited by Jari Oksanen, author of anosim and Adonis{vegan} in R)https://stat.ethz.ch/pipermail/r-sig-ecology/2013-June/003865.html


参考



  1. https://www.scribbr.com/frequently-asked-questions/one-way-vs-two-way-anova/


  2. MANOVA的前提假设 https://www.real-statistics.com/multivariate-statistics/multivariate-analysis-of-variance-manova/manova-assumptions/  https://www.statology.org/manova-assumptions/


  3. https://statistics.laerd.com/statistical-guides/one-way-anova-statistical-guide.php


  4. https://chrischizinski.github.io/rstats/vegan-ggplot2/


  5. https://chrischizinski.github.io/rstats/adonis/


  6. https://chrischizinski.github.io/rstats/ordisurf/


  7. https://www.rdocumentation.org/packages/vegan/versions/1.11-0/topics/adonis


  8. https://stats.stackexchange.com/questions/312302/adonis-in-vegan-order-of-variables-non-nested-with-one-degree-of-freedom-for


  9. https://stats.stackexchange.com/questions/188519/adonis-in-vegan-order-of-variables-or-use-of-strata?noredirect=1


  10. https://github.com/vegandevs/vegan/issues/229


  11. https://stats.stackexchange.com/questions/476256/adonis-vs-adonis2


  12. 清晰解释Type I, Type II, Type III https://mcfromnz.wordpress.com/2011/03/02/anova-type-iiiiii-ss-explained/


  13. 清晰解释Type I, Type II, Type III https://stats.stackexchange.com/questions/60362/choice-between-type-i-type-ii-or-type-iii-anova


  14. https://thebiobucket.blogspot.com/2011/08/two-way-permanova-adonis-with-custom.html#more


  15. adonis的前提条件 https://thebiobucket.blogspot.com/2011/04/assumptions-for-permanova-with-adonis.html#more


  16. 作者的论文 https://static1.squarespace.com/static/580e3c475016e191c523a0e2/t/5813ba8b5016e1a5b61f454a/1477687949842/Anderson_et_al-2013-ANOSIM+vs.+PERMANOVA.pdf



往期精品(点击图片直达文字对应教程)
















































机器学习


后台回复“生信宝典福利第一波”或点击阅读原文获取教程合集










浏览 35
点赞
评论
收藏
分享

手机扫一扫分享

分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

分享
举报