View source: R/gamma_statistic.R
gamma_statistic | R Documentation |
Given a rooted ultrametric phylogenetic tree, calculate the gamma-statistic (Pybus and Harevy, 2000).
gamma_statistic(tree)
tree |
A rooted tree of class "phylo". The tree is assumed to be ultrametric; any deviations from ultrametricity are ignored. |
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.
Numeric, the gamma-statistic of the tree.
Stilianos Louca
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.
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.