Learn R Programming

phangorn (version 1.5-0)

modelTest: ModelTest

Description

Comparison of different substition models

Usage

modelTest(object, tree=NULL, model = c("JC", "F81", "K80", "HKY", "SYM", "GTR"), G = TRUE, I = TRUE, k = 4, control = pml.control(epsilon = 1e-08, maxit = 3, trace = 1), multicore = FALSE)

Arguments

object
an object of class phyDat or pml
tree
a phylogenetic tree.
model
a vector containing the substitution models to compare with each other
G
logical, TRUE (default) if (discrete) Gamma modelshould be tested
I
logical, TRUE (default) if invariant sites should be tested
k
number of rate classes
control
A list of parameters for controlling the fitting process.
multicore
logical, whether models should estimated in parallel.

Value

  • A data.frame containing the log-likelihood, AIC and BIC all tested models. The data.frame has an attributes "env" which is an environment which contains all the trees, the data and the calls to allow get the estimated models, e.g. as a starting point for further analysis (see example).

Details

modelTest estimates all the specified models for a given tree and data. When the multicore package is available, the computations are done in parallel. This is only possible without GUI interface and under linux. Only nucleotide models are tested so far.

References

Posada, D. and Crandall, K.A. (1998) MODELTEST: testing the model of DNA substitution. Bioinformatics 14(9): 817-818

Posada, D. (2008) jModelTest: Phylogenetic Model Averaging. Molecular Biology and Evolution 25: 1253-1256

See Also

pml, anova

Examples

Run this code
example(NJ)
(mT <- modelTest(Laurasiatherian, tree))

# some R magic
env = attr(mT, "env")
ls(env=env)
(F81 <- get("F81+G", env)) # a call  
eval(F81, env=env)

data(chloroplast)
(mTAA <- modelTest(chloroplast, model=c("JTT", "WAG", "LG")))

Run the code above in your browser using DataLab