Closed yanxianl closed 5 years ago
I can't reproduce this
> adonis2(table ~ Diet, data = metadata, permutations = perm, method="bray")
Set of permutations < 'minperm'. Generating entire set.
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Plots: Tank, plot permutation: free
Permutation: none
Number of permutations: 719
adonis2(formula = table ~ Diet, data = metadata, permutations = perm, method = "bray")
Df SumOfSqs R2 F Pr(>F)
Diet 1 2.5381 0.70482 38.205 0.1
Residual 16 1.0630 0.29518
Total 17 3.6011 1.00000
with
but this might be due to my running a slightly updated version of permute which is making it's way on to CRAN now (it has been approved, but I don't think Windows builds are available just yet).
Confirming that this was fixed in permute many months ago https://github.com/gavinsimpson/permute/issues/23 but I didn't push a new version to CRAN at that time. A new version (0.9-5) went to CRAN yesterday and has been accepted which included this fix, which is why I couldn't reproduce the described problem with this version installed locally.
@yanxianl Once you update permute to 0.9-5 the problem you reported will go away. Apologies for the confusion over this.
Hi Gavin, updating permute package to 0.9-5 solved the problem. Thanks!
Hi,
I had an experiment comparing the performance of two diets for fish. Each diet was randomly allocated to triplicate tanks each containing 90 fish. The intestinal contents of fish were collected and sequenced for the profiling of gut microbiota. As samples taken from the same tank are not independent, a nested PERMANOVA was run to compare the difference in microbial community structure. Below is a reproducible illustration of the analysis I've done.
Created on 2019-03-12 by the reprex package (v0.2.1)
Session info
``` r devtools::session_info() #> - Session info ---------------------------------------------------------- #> setting value #> version R version 3.5.2 (2018-12-20) #> os Windows 10 x64 #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate English_United States.1252 #> ctype English_United States.1252 #> tz Europe/Berlin #> date 2019-03-12 #> #> - Packages -------------------------------------------------------------- #> package * version date lib source #> assertthat 0.2.0 2017-04-11 [2] CRAN (R 3.5.1) #> backports 1.1.3 2018-12-14 [2] CRAN (R 3.5.2) #> callr 3.1.1 2018-12-21 [2] CRAN (R 3.5.2) #> cli 1.0.1 2018-09-25 [2] CRAN (R 3.5.1) #> cluster 2.0.7-1 2018-04-13 [3] CRAN (R 3.5.2) #> crayon 1.3.4 2017-09-16 [2] CRAN (R 3.5.1) #> desc 1.2.0 2018-05-01 [2] CRAN (R 3.5.1) #> devtools 2.0.1 2018-10-26 [2] CRAN (R 3.5.1) #> digest 0.6.18 2018-10-10 [2] CRAN (R 3.5.1) #> evaluate 0.13 2019-02-12 [1] CRAN (R 3.5.2) #> fs 1.2.6 2018-08-23 [2] CRAN (R 3.5.1) #> glue 1.3.0 2018-07-17 [2] CRAN (R 3.5.1) #> highr 0.7 2018-06-09 [2] CRAN (R 3.5.1) #> htmltools 0.3.6 2017-04-28 [2] CRAN (R 3.5.1) #> knitr 1.21 2018-12-10 [1] CRAN (R 3.5.2) #> lattice * 0.20-38 2018-11-04 [3] CRAN (R 3.5.2) #> magrittr 1.5 2014-11-22 [2] CRAN (R 3.5.1) #> MASS 7.3-51.1 2018-11-01 [2] CRAN (R 3.5.1) #> Matrix 1.2-15 2018-11-01 [3] CRAN (R 3.5.2) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.2) #> mgcv 1.8-26 2018-11-21 [2] CRAN (R 3.5.1) #> nlme 3.1-137 2018-04-07 [3] CRAN (R 3.5.2) #> permute * 0.9-4 2016-09-09 [2] CRAN (R 3.5.1) #> pkgbuild 1.0.2 2018-10-16 [2] CRAN (R 3.5.1) #> pkgload 1.0.2 2018-10-29 [2] CRAN (R 3.5.1) #> prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.2) #> processx 3.2.1 2018-12-05 [2] CRAN (R 3.5.2) #> ps 1.3.0 2018-12-21 [2] CRAN (R 3.5.2) #> R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.2) #> Rcpp 1.0.0 2018-11-07 [2] CRAN (R 3.5.1) #> remotes 2.0.2 2018-10-30 [2] CRAN (R 3.5.1) #> rlang 0.3.1 2019-01-08 [1] CRAN (R 3.5.2) #> rmarkdown 1.11 2018-12-08 [1] CRAN (R 3.5.2) #> rprojroot 1.3-2 2018-01-03 [2] CRAN (R 3.5.1) #> sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 3.5.1) #> stringi 1.3.1 2019-02-13 [1] CRAN (R 3.5.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.5.2) #> testthat 2.0.1 2018-10-13 [2] CRAN (R 3.5.1) #> usethis 1.4.0 2018-08-14 [2] CRAN (R 3.5.1) #> vegan * 2.5-4 2019-02-04 [1] CRAN (R 3.5.2) #> withr 2.1.2 2018-03-15 [2] CRAN (R 3.5.1) #> xfun 0.5 2019-02-20 [1] CRAN (R 3.5.2) #> yaml 2.2.0 2018-07-25 [2] CRAN (R 3.5.1) #> #> [1] C:/R/library #> [2] \\nmbu.no/my/Home/Documents/R/win-library/3.5 #> [3] C:/Program Files/R/R-3.5.2/library ```If I understand correctly, the number of all possible permutations under the above permutation scheme should be 6^5^4^3^2^1 = 720 (only tanks are shuffled, n = 6). However, it's only 200 which I couldn't figure out why. Did I use a wrong permutation scheme for my experiment setup?
Any helps are greatly appreciated.
Yanxian