testBetaDiversity: Test beta diversity

View source: R/s3functions.R

testBetaDiversityR Documentation

Test beta diversity

Description

Hypothesis testing for beta-diversity.

Usage

testBetaDiversity(dv, h0, groups, sample_specimen_matrix, n_boot = 1000)

Arguments

dv

An object of class diversityEstimates. The variable 'X' used for the construction

h0

The beta-diversity index to be tested for equality

groups

A numeric vector giving group membership of each specimen

sample_specimen_matrix

A matrix with ik-th entry 1 if the i-th sequenced sample is taken from specimen k, 0 otherwise. The columns of this matrix should correspond to unique specimens and must be named.

n_boot

Number of (cluster) bootstrap resamples to use

Details

This function uses output from DivNet() to estimate community centroids within groups defined by the groups argument and test a null hypothesis of equality of all group centroids against a general alternative. This test is conducted using a pseudo-F statistic with null distribution approximated via a nonparametric bootstrap.

For more details and suggested workflow see the beta diversity vignette: vignette("beta_diversity", package = "DivNet")

Value

A list containing the observed pseudo-F statistic, the beta diversity used, the p-value returned by the bootstrapped pseudo-F test of equality of (measured) centroids, a vector of computed bootstrapped test statistics, a matrix of estimated group centroids, and a list of group centroids estimated from each bootstrap resample #'


adw96/DivNet documentation built on Oct. 2, 2023, 11:49 a.m.