phylo.d.subset: Calculates the phylogenetic D statistic across clades within...

View source: R/phylo.d.subset.R

phylo.d.subsetR Documentation

Calculates the phylogenetic D statistic across clades within a phylogeny

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. Does this across clades within a phylogeny.

Usage

phylo.d.subset(data, phy, names.col, binvar, permut = 1000, rnd.bias=NULL, 
	           min.tips=1, max.tips=length(data$phy$tip.label), min.nodes=1, 
			   max.nodes=data$phy$Nnode, verbose=FALSE)
## S3 method for class 'phylo.d.subset'
print(x, ...)
## S3 method for class 'phylo.d.subset'
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.

rnd.bias

An optional name of a variable in data holding probability weights to bias the generation of the random distribution. See 'destails'

verbose

Logical; do you want to know how many clades are being assessed, and see when each is being assessed?

min.tips

The minimum number of tips a clade should have for it to have a D value calculated. Defaults to 1 (i.e. no limit).

max.tips

The maximum number of species a clade should have for it to have a D value calculated. Defaults to the number of species in the whole phylogeny (i.e. no limit).

min.nodes

The minimum number of nodes a clade should have for it to have a D value calculated. Defaults to 1 (i.e. no limit).

max.nodes

The maximum number of nodes a clade should have for it to have a D value calculated. Defaults to the number of nodes in the whole phylogeny (i.e. no limit).

x

An object of class 'phylo.d.subset'

object

An object of class 'phylo.d.subset'

...

Further arguments to print and summary methods

Details

A wrapper function for phylo.d, calculating D values for clades within a given dataset. These clades can be filtered according to the number of species and nodes using the arguments above. See phylo.d for more details on the method itself.

Any clades for which there is no variation in the binary variable have NA values for all of the below slots.

Value

Returns an object of class 'phylo.d.subset', which is a list of the following:

raw

A list of the raw output from phylo.d for each clade

DEstimate

A vector of the estimated D values

Pval1

A vector of p values, giving the result of testing whether D is significantly different from one, for each clade

Pval0

A vector of p values, giving the result of testing whether D is significantly different from zero, for each clade

phy.depth

A numeric vector giving the age of the clade for which each value was calculated

Author(s)

Susanne Fritz (SFritz@bio.ku.dk), Will Pearse and David Orme

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

data(BritishBirds)
BritishBirds <- comparative.data(BritishBirds.tree, BritishBirds.data, binomial)
# Look at big clades only
## Not run: 
bigClades <- phylo.d.subset(BritishBirds, binvar=Red_list, verbose=TRUE, min.tips=10, min.nodes=5)
print(bigClades)

## End(Not run)

caper documentation built on Sept. 26, 2023, 5:10 p.m.