Learn R Programming

iteRates (version 3.1)

comp.subs: comp.subs

Description

The function implements the parametric rate comparison test. The function iterates through all subtrees of a phylogenetic tree and compares the distribution of branch lengths in the subtree to the "remainder" tree. It is intended to be used with a chronogram in order to test whether diversification rates differ among clades within a broader phylogeny. A variety of truncated distributions can be used and compared via likelihood.

Usage

comp.subs(tree, thr = 6, srt = "drop", min.val = 0.01,
mod.id = c(1, 0, 0, 0),verbose=TRUE)

Arguments

tree
An object of class phylo. To test variation in diversification rates, this should be a chronogram.
thr
Threshold subtree or remainder tree size below which comparisons should not be performed. thr is the minimum number of edges (in either the subtree or remainder tree) for a comparison to be made.
srt
Treatment of subtree root edge. Default is "drop" meaning the edge subtending each subtree will be left out of the comparison for that subtree. Alternatives "in" or "out" classify the subtree root edge as part of the subtree or part of the remainder tree,
min.val
Replacement of zero-length branches with a small positive number to avoid spurious zeros in likelihood calculations. This value is treated as a fraction of the maximum branch (it is multiplied by the maximum edge length and that resultant is substituted f
mod.id
Indicator vector specifying statistical distributions to be fit to the data. In order, the distributions are exponential, Weibull, lognormal, and variable rates Venditti et al. 2010. Default is exponential only.
verbose
A logical indicating whether progress is updated on the screen

Value

  • A data frame containing up to 15 variables for each subtree of tree. Each row corresponds to a subtree and the order is that returned by the function subtrees. Subtrees that are not tested (owing to failure to meet the thr threshold) have NA's for all variables:
  • Par1.totFirst estimated parameter of the best fit model for the pooled edge lengths of the subtree and remainder tree. For exponential, this is the rate. For Weibull it is the "shape" parameter. For lognormal it is mu. For the variable rates distribution it is alpha.
  • Par2.totSecond estimated parameter of the best fit model for the pooled edge lengths. For exponential, it is NA. For Weibull it is the "scale" parameter. For lognormal, it is sigma. For variable rates, it is beta.
  • Par1.tr1First estimated parameter for the best fit model for the subtree
  • Par2.tr1Second estimated parameter for the best fit model for the subtree
  • Par1.tr2First estimated parameter for the best fit model for the remainder tree
  • Par2.tr2Second estimated parameter for the best fit model for the remainder tree
  • llk.1rlog likelihood of the best fit model for the pooled set of edges: the one-rate model.
  • llk.2rlog likelihood for the best two-rate model
  • mod.1r.totBest fit distribution for the one-rate model: 1=exponential, 2=Weibull, 3=lognormal, 4=variable rates
  • mod.2r.tr1Best fit distribution for the subtree under the two-rate model
  • mod.2r.tr2Best fit distribution for the remainder tree under the two-rate model
  • node1Identifies the node corresponding to the most recent common ancestor of the subtree and its sister clade. That is, the node ancestral to the branch along which a rate change might have occured.
  • node2Identifies the most recent common ancestor of all taxa in the subtree. That is, the descendant node of the branch along which a rate chage might have occurred.
  • p.valP-value from the likelihood ratio test of the two-rate vs. one-rate model for the subtree defined by node2
  • EvidRatioThe evidence ratio from the AICc scores of the two-rate vs. one-rate model for the subtree defined by node2

Details

All distributions are fit using the likelihood for the truncated form

References

Shah, P., B. M. Fitzpatrick, and J. A. Fordyce. 2013 A parametric method for assessing diversification rate variation in phylogenetic trees. Evolution 67:368-377. Venditti, C., A. Meade, and M. Pagel, 2010. Phylogenies reveal new interpretation of speciation and the red queen. Nature 463:349-352.

Examples

Run this code
data(geospiza)
attach(geospiza)
comp.subs(geospiza.tree)

Run the code above in your browser using DataLab