Learn R Programming

castor (version 1.6.1)

gamma_statistic: Calculate the gamma-statistic of a tree.

Description

Given a rooted ultrametric phylogenetic tree, calculate the gamma-statistic (Pybus and Harevy, 2000).

Usage

gamma_statistic(tree)

Arguments

tree

A rooted tree of class "phylo". The tree is assumed to be ultrametric; any deviations from ultrametricity are ignored.

Value

Numeric, the gamma-statistic of the tree.

Details

The tree may include multifurcations and monofurcations. If edge lengths are missing (i.e. edge.length=NULL), then each edge is assumed to have length 1.

This function is similar to the function gammaStat in the R package ape v5.3.

References

O. G. Pybus and P. H. Harvey (2000). Testing macro-evolutionary models using incomplete molecular phylogenies. Proceedings of the Royal Society of London. Series B: Biological Sciences. 267:2267-2272.

Examples

Run this code
# NOT RUN {
# generate a random tree
Ntips = 100
tree = generate_random_tree(list(birth_rate_intercept=1),Ntips)$tree

# calculate & print gamma statistic
gammastat = gamma_statistic(tree)
cat(sprintf("Tree has gamma-statistic %g\n",gammastat))
# }

Run the code above in your browser using DataLab