前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >画一个带统计检验的PcOA分析结果 (再进一步,配对比较)

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

作者头像
生信宝典
发布2022-01-18 21:16:30
发布2022-01-18 21:16:30
1.5K00
代码可运行
举报
文章被收录于专栏:生信宝典生信宝典
运行总次数:0
代码可运行

前期回顾

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

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

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

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

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

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

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

代码语言:javascript
代码运行次数:0
运行
复制
# 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

拼一起画个图

代码语言:javascript
代码运行次数:0
运行
复制
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
代码语言:javascript
代码运行次数:0
运行
复制
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
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-09-26,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 生信宝典 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前期回顾
  • 配对Adonis确定不同管理方式两两之间对物种组成差异的影响
  • 参考
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档