Learn R Programming

phytools (version 0.2-40)

phylosig: Compute phylogenetic signal with two methods

Description

This function computes phylogenetic signal using two different methods. It can also conduct the hypothesis tests for significant phylogenetic signal, and estimate phylogenetic signal incorporating sampling error following Ives et al. (2007).

Usage

phylosig(tree, x, method="K", test=FALSE, nsim=1000, se=NULL, start=NULL,
     control=list())

Arguments

tree
a phylogenetic tree in "phylo" format.
x
vector containing values for a single continuously distributed trait.
method
method to compute signal: can be "K" or "lambda".
test
logical indicating whether or not to conduct a hypothesis test of "K" or "lambda".
nsim
for method="K", number of simulations in randomization test.
se
named vector containing the standard errors for each species.
start
vector of starting values for optimization of (respectively) sigma^2 and lambda. Only used in method="lambda" and se!=NULL.
control
list of control parameters for multidimensional optimization, implemented in optim. Only used in method="lambda" and se!=NULL.

Value

  • if (method="K"), a list with the following components:
  • Kvalue of the K-statistic.
  • sig2rate of evolution, $\sigma^2$, for estimation with sampling error.
  • logLlog-likelihood, for estimation with sampling error.
  • Poptionally, the P-value from the randomization test.
  • if (method="lambda"), a list with the following components:
  • lambdafitted value of lambda.
  • sig2rate of evolution, for estimation with sampling error.
  • logLlog-likelihood.
  • logL0log-likelihood for lambda=0.0.
  • PP-value of the likelihood ratio test.
  • convergencevalue for convergence, for estimation with sampling error only. (See optim).
  • messagemessage from optim, for estimation with sampling error only.

Details

$\lambda$ optimization is performed using optimize with the range of lambda set between 0 and the theoretical upper limit of lambda (determined by the relative height of the most recent internal node on the tree).

References

Pagel, M. 1999. Inferring the historical patterns of biological evolution. Nature, 401, 877--884. Blomberg, S. P., T. Garland Jr., A. R. Ives. 2003. Testing for phylogenetic signal in comparative data: Behavioral traits are more labile. Evolution, 57, 717--745. Ives, A. R., P. E. Midford, T. Garland Jr. 2007. Within-species variation and measurement error in phylogenetic comparative biology. Systematic Biology, 56, 252-270.

Examples

Run this code
tree<-pbtree(n=100)
	x<-fastBM(tree)
	phylosig(tree,x,method="lambda",test=TRUE)

Run the code above in your browser using DataLab