ratebytree: Likelihood test for rate variation among trees, clades, or...

View source: R/ratebytree.R

ratebytreeR Documentation

Likelihood test for rate variation among trees, clades, or traits

Description

Multiple methods for comparing the rate or process of evolution between trees.

Usage

ratebytree(trees, x, ...)
## S3 method for class 'ratebytree'
posthoc(x, ...)

Arguments

trees

an object of class "multiPhylo". If x consists of a list of different traits to be compared, then trees could also be a simple set of duplicates of the same tree, e.g., rep(tree,length(x)).

x

a list of trait vectors for a continuous trait in which the names of each vectors correspond to the tip labels of trees. This is not used if type="diversification". In the case of posthoc.ratebytree, an object of class "ratebytree".

...

optional arguments, including the argument type ("continuous", "discrete", or "diversification"), which, if not specified, the function will attempt to ascertain. See Details for more information.

Details

This function essentially implements three different methods for comparing the rate or process of evolution between trees: one for continuously-valued traits, a second for discrete characters, and a third for the rate of diversification (speciation & extinction).

In all cases, the function takes an object of class "multiPhylo" containing two or more phylogenies (trees), and (for the first two analyses) a list of trait vectors (x).

For continuous traits, the function then proceeds to fit two models: one in which the rate (or regime, for models "OU" and "EB") of trait evolution is equal among all trees; and a second in which the rates or regimes can differ between trees.

The latter model corresponds to an extension of the censored approach of O'Meara et al. (2006; Revell et al. 2018) and should also be related to the method of Adams (2012) for comparing rates among traits. See brownie.lite for a different implementation of the noncensored approach of O'Meara et al. (2006).

For discrete traits, the function instead proceeds to fit two variants of the Mk model (Lewis 2001): one in which the parameters values (transition rates) of the process are free to vary between trees, and a second in which they are fixed to be the same.

For diversification alone, the function fits two different diversification (speciation & extinction) models (Nee et al. 1994; Stadler 2012): one in which the birth (speciation) and death (extinction) rates are identical between the trees, and a second in which they are permitted to differ in various ways depending on the value of "model" (Revell 2018).

The method posthoc conducts a post-hoc comparison of parameter estimates between trees in the multi-rate or multi-process model. The parameter that is compared depends on the fitted model. For instance, in model="BM" posthoc comparison is made of sig2; if model="OU" fitted values of alpha are compared; and so on. The argument p.adjust.method can be used to specify a method for adjusting P-values for multiple tests following p.adjust (defaults to p.adjust.method="none".

At present it is not possible to specify different models to fit for the different trees - although if (for instance) character evolution on tree 1 proceeded by a strong OU process while character evolution on tree 2 was by BM, we would probably reject a constant-process model and tree 2 should show a very low value of alpha.

To compute the standard errors for each fitted parameter value, the function computes the negative inverse of the Hessian matrix at the MLEs; however, if this matrix is computationally singular the generalized inverse (ginv) will be used instead without warning.

The function also conducts a likelihood-ratio test to compare the two models.

For continuous character, optional arguments presently include the following: model, the model of continuous trait evolution (options are "BM", the default, "OU", and "EB"). tol, used as a minimum value for the fitting rates, to prevent problems in optimization. trace, a logical value indicating whether or not to report progress in the optimization. test, the method for hypothesis testing (options are "chisq" and "simulation"). quiet, a logical value indicating whether or not to run perfectly quietly. Finally, se, a list of vectors containing the standard errors for each value of x.

For type="discrete" the optional arguments are slightly different. The argument model can be used, but it must assume the values "ER", "SYM", "ARD", or a numeric matrix following ace.

Finally, for type= "diversification" models are so far "birth-death", "equal-extinction", and "equal-specation", and "Yule". It is also important to consider supplying the sampling fractions, rho, which is a vector of values between 0 and 1 of the same length as trees. If not provided the method will assume a sampling fraction of 1.0 for all trees - which is seldom true of empirical studies.

Value

An object of class "ratebytree" or an object of class "posthoc.ratebytree" in the case of the method posthoc.

Author(s)

Liam Revell liam.revell@umb.edu

References

Adams, D. C. (2012) Comparing evolutionary rates for different phenotypic traits on a phylogeny using likelihood. Syst. Biol., 62, 181-192.

Lewis, P. O. (2001) A likelihood approach to estimating phylogeny from discrete morphological character data. Systematic Biology, 50, 913-925.

Nee, S., May, R. M. and Harvey, P. H. (1994) The reconstructed evolutionary process. Philosophical Transactions of the Royal Society of London B, 344, 305-311.

O'Meara, B. C., C. Ane, M. J. Sanderson, and P. C. Wainwright. (2006) Testing for different rates of continuous trait evolution using likelihood. Evolution, 60, 922-933.

Revell, L. J. (2018) Comparing the rates of speciation and extinction between phylogenetic trees. Ecology and Evolution, 8, 5303-5312.

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

Revell, L. J., Gonzalez-Valenzuela, L. E., Alfonso, A., Castellanos-Garcia, L. A., Guarnizo, C. E., and Crawford, A. J. (2018) Comparing evolutionary rates between trees, clades, & traits. Methods Ecol. Evol., 9, 994-1005.

Stadler, T. (2012) How can we improve the accuracy of macroevolutionary rate estimates? Systematic Biology, 62, 321-329.

See Also

brownie.lite, fitMk


liamrevell/phytools documentation built on March 4, 2024, 3:27 a.m.