首页 > 编程知识 正文

如何画统计表,如何画折线统计

时间:2023-05-04 20:03:21 阅读:276535 作者:2770

前期回顾

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

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

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

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

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

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

这时就需要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# 调布局

ANOSIM和PERMANOVA的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

参考

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

机器学习

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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。