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).
phylosig(tree, x, method="K", test=FALSE, nsim=1000, se=NULL, start=NULL,
control=list())
# S3 method for phylosig
plot(x, ...)
a phylogenetic tree in "phylo"
format.
vector containing values for a single continuously distributed trait. In the case of the plot
method, x
is an object of class "phylosig"
.
method to compute signal: can be "K"
or "lambda"
.
logical indicating whether or not to conduct a hypothesis test of "K"
or "lambda"
.
for method="K"
, number of simulations in randomization test.
named vector containing the standard errors for each species.
vector of starting values for optimization of (respectively) \(\sigma^2\) and \(\lambda\). Only used in method="lambda"
and se!=NULL
.
list of control parameters for multidimensional optimization, implemented in optim
. Only used in method="lambda"
and se!=NULL
.
optional arguments for plot
method.
The function returns an object of class "phylosig"
. With default arguments (method="K"
, test=FALSE
, and se=NULL
), this will be a single numeric value. Otherwise, if (method="K")
, it will consist of a list with up to the following components:
value of the K-statistic.
rate of evolution, \(\sigma^2\), for estimation with sampling error.
log-likelihood, for estimation with sampling error.
optionally, the P-value from the randomization test.
fitted value of \(\lambda\).
rate of evolution, for estimation with sampling error.
log-likelihood.
log-likelihood for lambda=0.0
.
P-value of the likelihood ratio test.
value for convergence, for estimation with sampling error only. (See optim
).
message from optim
, for estimation with sampling error only.
\(\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).
plot.phylosig
creates either a plot of the null distribution of K or a likelihood surface, depending on the value of method
.
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.
Pagel, M. (1999) Inferring the historical patterns of biological evolution. Nature, 401, 877-884.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
# NOT RUN {
tree<-pbtree(n=100)
x<-fastBM(tree)
phylosig(tree,x,method="lambda",test=TRUE)
# }
Run the code above in your browser using DataLab