R: Calculate the gamma-statistic of a tree.

gamma_statistic {castor} | R Documentation

## 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.

### 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.

### Value

Numeric, the gamma-statistic of the tree.

### Author(s)

Stilianos Louca

### 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

    # 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))

[Package castor version 1.6.8 Index]