Skip to content

Commit

Permalink
wis
Browse files Browse the repository at this point in the history
  • Loading branch information
WisamSaleem committed Oct 19, 2020
1 parent 8ca7ccb commit c912c2c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
19 changes: 13 additions & 6 deletions post_hoc.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "post_hoc"
title: "Post-hoc tests for non-parametric comparison"
author: "Leo Lahti, Sudarshan Shetty et al."
bibliography:
- bibliography.bib
Expand Down Expand Up @@ -51,6 +51,7 @@ print(p)

### Test statistical significance by Kruskal-Wallis

* [kruskal wallis test](http://www.sthda.com/english/wiki/kruskal-wallis-test-in-r#what-is-kruskal-wallis-test)

```{r kruskal, message=FALSE, error=FALSE, warning=FALSE}
Expand All @@ -65,8 +66,7 @@ sample_data(pseq)$signal <- get_sample(pseq, tax)
attach(meta(pseq))
res<- pairwise.wilcox.test(signal, group, p.adjust.method = 'BH')
resK<- kruskal.test(signal, group) # source: http://www.sthda.com/english/wiki/kruskal-wallis-test-in-r#what-is-kruskal-wallis-test
# Show the results
resK<- kruskal.test(signal, group)
print(resK)
```

Expand All @@ -78,6 +78,8 @@ From the output of the Kruskal-Wallis test, if there is a significant difference

##### 1. Pairwise Wilcoxon tests with multiple testing correction, p.adjust.method is Benjamini-Hochberg

* [Pairwise Wilcoxon tests](https://bookdown.org/thomas_pernet/Tuto/non-parametric-tests.html#wilcoxon-whitney-wilcoxon-test)

```{r post_hoc_Pairwise_Wilcoxon_tests, message=FALSE, error=FALSE, warning=FALSE}
library(tidyr)
Expand All @@ -103,6 +105,8 @@ print(res)

#### 2. Dunn's test, p.adjust.method is Benjamini-Hochberg

* [Dunn test](https://cran.r-project.org/web/packages/dunn.test/dunn.test.pdf)

```{r post_hoc_dunn.test, message=FALSE, error=FALSE, warning=FALSE}
library(dunn.test)
Expand All @@ -115,7 +119,7 @@ sample_data(pseq)$signal <- get_sample(pseq, tax)
attach(meta(pseq))
res<- dunn.test::dunn.test(signal, group, method = 'bh') # source:https://cran.r-project.org/web/packages/dunn.test/dunn.test.pdf
res<- dunn.test::dunn.test(signal, group, method = 'bh')
```
Expand All @@ -125,6 +129,8 @@ res<- dunn.test::dunn.test(signal, group, method = 'bh') # source:https://cran.r

#### 3. Pairwise Multiple Comparison of Mean Ranks (PMCMR)

* [PMCMR](https://cran.r-project.org/web/packages/PMCMR/vignettes/PMCMR.pdf)

```{r post_hoc_PMCMR, message=FALSE, error=FALSE, warning=FALSE}
library(PMCMR)
Expand All @@ -137,7 +143,7 @@ sample_data(pseq)$signal <- get_sample(pseq, tax)
attach(meta(pseq))
res<- PMCMR::posthoc.kruskal.nemenyi.test(signal, group,dist='Chisq',p.adjust.methods= 'BH') # source:https://cran.r-project.org/web/packages/PMCMR/vignettes/PMCMR.pdf
res<- PMCMR::posthoc.kruskal.nemenyi.test(signal, group,dist='Chisq',p.adjust.methods= 'BH')
# Show the results
print(res)
Expand All @@ -147,6 +153,8 @@ print(res)

#### 4. Conover-Iman Test of Multiple Comparisons Using Rank Sums, p.adjust.method is Benjamini-Hochberg

* [Conover-Iman Test](https://cran.r-project.org/web/packages/conover.test/conover.test.pdf)

```{r post_hoc_Conover-Iman, message=FALSE, error=FALSE, warning=FALSE}
library(conover.test)
Expand All @@ -157,7 +165,6 @@ tax <- "Akkermansia"
# Pick the signal (abundance) for this tax
sample_data(pseq)$signal <- get_sample(pseq, tax)
# source:https://cran.r-project.org/web/packages/conover.test/conover.test.pdf
attach(meta(pseq))
res<- conover.test::conover.test(signal, group, method = 'bh')
Expand Down

0 comments on commit c912c2c

Please sign in to comment.