Learn R Programming

caper (version 0.4)

phylo.d: Calculates the phylogenetic D statistic

Description

Calculates the D value, a measure of phylogenetic signal in a binary trait, and tests the estimated D value for significant departure from both random association and the clumping expected under a Brownian evolution threshold model.

Usage

phylo.d(data, phy, names.col, binvar, permut = 1000)
## S3 method for class 'phylo.d':
print(x, ...)
## S3 method for class 'phylo.d':
summary(object, ...)

Arguments

data
A 'comparative.data' or 'data.frame' object.
phy
An object of class 'phylo', required when data is not a 'comparative.data' object.
names.col
A name specifying the column in 'data' that matches rows to tips in 'phy', required when data is not a 'comparative.data' object.
binvar
The name of the variable in data holding the binary variable of interest.
permut
Number of permutations to be used in the randomisation test.
x
An object of class 'phylo.d'
object
An object of class 'phylo.d'
...
Further arguments to print and summary methods

Value

  • Returns an object of class 'phylo.d', which is a list of the following:
  • DEstimateThe estimated D value
  • Pval1A p value, giving the result of testing whether D is significantly different from one
  • Pval0A p value, giving the result of testing whether D is significantly different from zero
  • ParametersA list of the Observed, MeanRandom and MeanBrownian sums of sister-clade differences
  • PermutationsA list with elements random and brownian, containing the sums of sister-clade differences from random permutations and simulations of Brownian evolution under a threshold model
  • NodalValsA list with the elements observed, random and brownian, containing the nodal values estimated for the observed trait and permutations. The values are as matrices with rows labelled by the node names in the comparative data object.
  • binvarThe binary variable used
  • phyNameThe name of the phylogeny object used
  • dsNameThe name of the dataframe used
  • nPermutThe number of permutations used

Details

The sum of changes in estimated nodal values of a binary trait along edges in a phylogeny (D) provides a measure of the phylogenetic signal in that trait (Fritz and Purvis, 2010). If a trait is highly conserved, with only a basal division between two clades expressing either trait value, then the only change will be along the two daughters at the root. This will give a summed value of 1: the two differences between the root nodal value of 0.5 and the ancestors of the 1 and 0 clades. In contrast, if the trait is labile, more differences will be observed and the sum will be higher.

This function calculates the observed D for a binary trait on a tree and compares this to the value of D found using an equal number of simulations under each of two models: [object Object],[object Object] The value of D depends on phylogeny size - more sister clades yield higher sums - and so the means of the two sets of simulated data are used as calibrations to scale both observed and simulated values of D to set points of 0 (as phylogenetically conserved as expected under a Brownian threshold model) and 1 (random). The value of D can be both smaller than 0 (highly conserved) and greater than 1 (overdispersed) and the distributions of scaled D from the simulations are used to assess the significance of the observed scaled D.

References

Fritz, S. A. and Purvis, A. (2010). Selectivity in mammalian extinction risk and threat types: a new measure of phylogenetic signal strength in binary traits. Conservation Biology, 24(4):1042-1051.

Examples

Run this code
data(BritishBirds)
BritishBirds <- comparative.data(BritishBirds.tree, BritishBirds.data, binomial)
redPhyloD <- phylo.d(BritishBirds, binvar=Red_list)
print(redPhyloD)

Run the code above in your browser using DataLab