Learn R Programming

iteRates (version 3.1)

comp.fit.subs: comp.fit.subs

Description

The function implements the K-clades parametric rate comparison test. This function compares rate estimates among defined subtrees and evaluates various groupings from 1 to k groups for these subtrees.

Usage

comp.fit.subs(trees, focal, k, mod.id = c(1, 0, 0, 0), min.val = 0.01)

Arguments

trees
A list from from function id.subtrees.
focal
A vector indicating the subtrees to compare
k
A value indicting the maximum number of groupings of subtrees to examine
mod.id
A vector with four elements of 0 or 1 indicating which models to consider. 1 indicates that the model should be considered. 0 indicates the model is not considered. These for elements refer to an exponential, Weibel, lognormal, and rate variable, respecti
min.val
A value for determining the minimum edge length for a tree scaled against the longest edge length. A value of 0.01 (the default) rescales the minimum edge length to 1

Value

  • A dataframe that consists of the following:
  • kThe number of groups
  • GroupsThe groupings for each subtree numbered as 1 to the number of subtrees indicated. The numbering corresponds to the order in which subtrees are identified by focal. Groups are separated with vs.
  • gi_PjThe jth parameter value for the ith group in the analysis
  • gi_mod.idThe best model chosen for the ith group
  • gi_n.paramThe number of parameters in the best model for the ith group
  • AICAkaike information criterion score for the entire model for a grouping scheme
  • AICcAkaike information criterion corrected for sample size
  • dAICcThe delta AIC across all grouping schemes and k values relative to the best fit model

Details

The list of possible subtrees is provided by the function id.subtrees. The function will explore all possible groupings of subtrees into k defined groups choosing the best fit model for each partition from among the models identified by mod.id.

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.

See Also

tab.summary id.subtrees

Examples

Run this code
data(hivtree.newick)
cat(hivtree.newick, file = "hivtree.phy", sep = "") 
tree.hiv <- read.tree("hivtree.phy") # load tree 
unlink("hivtree.phy") # delete the file "hivtree.phy" 

idHIV<-id.subtrees(tree.hiv)
plot(idHIV$tree,show.node.label=TRUE)
cfsHIV<-comp.fit.subs(idHIV$subtree,focal=c(153,119,96,5),k=4)

Run the code above in your browser using DataLab