perform_anosim() performs the anosim test for statistical difference
between groups of samples. The null hypothesis is that there is no difference
between microbial communities in the groups of samples.
Arguments
- ta
A tidytacos object.
- group
A column in the sample table to group the samples on.
- ...
Arguments passed on to
vegan::anosimxData matrix or data frame in which rows are samples and columns are response variable(s), or a dissimilarity object or a symmetric square matrix of dissimilarities.
groupingFactor for grouping observations.
permutationsa list of control values for the permutations as returned by the function
how, or the number of permutations required, or a permutation matrix where each row gives the permuted indices.distanceChoice of distance metric that measures the dissimilarity between two observations. See
vegdistfor options. This will be used ifxwas not a dissimilarity structure or a symmetric square matrix.strataAn integer vector or factor specifying the strata for permutation. If supplied, observations are permuted only within the specified strata.
parallelNumber of parallel processes or a predefined socket cluster. With
parallel = 1uses ordinary, non-parallel processing. The parallel processing is done with parallel package.
Examples
perform_anosim(urt, method, dist = "jaccard")
#> Warning: Empty samples found, ignoring them in analysis
#> Warning: Removed 3 empty samples.
#>
#> Call:
#> vegan::anosim(x = M, grouping = ta$samples %>% pull(!!group), distance = "jaccard")
#> Dissimilarity: jaccard
#>
#> ANOSIM statistic R: -0.05501
#> Significance: 0.827
#>
#> Permutation: free
#> Number of permutations: 999
#>
# no statistical difference based on the method column
# (high significance value and R close to 0).
