## 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)))
Run the code above in your browser using DataLab