View source: R/test.dispRity.R
test.dispRity | R Documentation |
Applying statistical tests to dispRity objects
test.dispRity(
data,
test,
comparisons = "pairwise",
rarefaction = NULL,
correction = "none",
concatenate = TRUE,
conc.quantiles = c(mean, c(95, 50)),
details = FALSE,
...
)
data |
A |
test |
A test |
comparisons |
If data contains more than two subsets, the type of comparisons to apply: either |
rarefaction |
A |
correction |
Which p-value correction to apply to |
concatenate |
Logical, whether to concatenate bootstrapped disparity values ( |
conc.quantiles |
If |
details |
Whether to output the details of each test (non-formatted; default = |
... |
Additional options to pass to the test |
The comparison
argument can be:
"pairwise"
: pairwise comparisons of all the subsets (default).
"referential"
: compares the first subset to all the others.
"sequential"
: compares each subset sequentially (e.g. first against second, second against third, etc.).
"all"
: compares all the subsets simultaneously to the data (i.e. bootstrapped disparity ~ subsets names
). This argument is used for lm
or glm
type tests.
A list of pairs of number of subsets to compare. Each element of the list must contain two elements
(e.g. list(c("a","b"), ("b", "a"))
to compare "a" to "b" and then "b" to "a").
If the called test is null.test
, the comparison argument is ignored.
IMPORTANT: if you are performing multiple comparisons (e.g. when using "pairwise"
, "referential"
or "sequential"
), don't forget about the Type I error rate inflation. You might want to use a p-value correction (see p.adjust
).
Thomas Guillerme
dispRity
, null.test
, bhatt.coeff
, pair.plot
, adonis.dispRity
, randtest.dispRity
, test.dispRity
## Load the Beck & Lee 2014 data
data(BeckLee_mat50)
data(BeckLee_tree)
## Calculating the disparity from customised subsets
## Generating the subsets
groups <- crown.stem(BeckLee_tree, inc.nodes = FALSE)
customised_subsets <- custom.subsets(BeckLee_mat50, groups)
## Bootstrapping the data
bootstrapped_data <- boot.matrix(customised_subsets, bootstraps = 100)
## Calculating the sum of variances
sum_of_variances <- dispRity(bootstrapped_data, metric = c(sum, variances))
## Measuring the subset overlap
test.dispRity(sum_of_variances, bhatt.coeff, "pairwise")
## Measuring differences from a reference subset
test.dispRity(sum_of_variances, wilcox.test, "referential")
## Measuring disparity as a distribution
disparity_var <- dispRity(bootstrapped_data, metric = variances)
## Differences between the concatenated bootstrapped values of the subsets
test.dispRity(disparity_var, test = t.test, comparisons = "pairwise",
concatenate = TRUE, correction = "bonferroni")
## Differences between the subsets bootstrapped
test.dispRity(disparity_var, test = t.test, comparisons = "pairwise",
concatenate = FALSE, correction = "bonferroni",
conc.quantiles = c(mean, c(95, 5)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.