The function tests the presence of phylogenetic clustering for
species within a focal state.
Usage
phyloclust(tree,state,focal,nsim=100)
Value
The function returns a list including the p-value ($p) for the test
of phylogenetic clustering and a $declusterized object containing the
declusterized versions of the original tree and state vector (i.e. tips are
removed as to make p>0.05) and the vector of removed species.
Arguments
tree
a phylogenetic tree. The tree needs not to be ultrametric or
fully dichotomous.
state
the named vector of tip states.
focal
the focal state to be tested for phylogenetic clustering.
nsim
number of simulations to perform the phylogenetic clustering
test.
Author
Silvia Castiglione, Pasquale Raia
Details
To test for phylogenetic clustering, the function computes the mean
cophenetic (i.e. evolutionary time) distance between all the species under
the focal state. Such value is compared to a random distribution of
time distances obtained by sampling nsim times as many random tips
as those under the focal state. In the presence of significant
phylogenetic clustering, tips under the focal state are randomly
removed until the p becomes >0.05 or only 3 tips are left.