phylosig | R Documentation |
Calculate phylogenetic signal using two different methods (Pagel, 1999; Blomberg et al., 2003).
phylosig(tree, x, method="K", test=FALSE, nsim=1000, se=NULL, start=NULL,
control=list(), niter=10)
## S3 method for class 'phylosig'
plot(x, ...)
tree |
a phylogenetic tree in |
x |
vector containing values for a single continuously distributed trait. In the case of the |
method |
method to compute signal: can be |
test |
logical indicating whether or not to conduct a hypothesis test of |
nsim |
for |
se |
named vector containing the standard errors for each species. |
start |
vector of starting values for optimization of (respectively) |
control |
list of control parameters for multidimensional optimization, implemented in |
niter |
number of iterations for likelihood optimization of |
... |
optional arguments for |
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).
\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
.
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 elements:
K |
value of the K-statistic. |
sig2 |
rate of evolution, |
logL |
log-likelihood, for estimation with sampling error. |
P |
optionally, the P-value from the randomization test. |
If (method="lambda")
, it will be a list with up to the following elements:
lambda |
fitted value of |
sig2 |
rate of evolution, |
logL |
log-likelihood. |
logL0 |
log-likelihood for |
P |
P-value of the likelihood ratio test. |
convergence |
value for convergence, for estimation with sampling error only. (See |
message |
message from |
Liam Revell liam.revell@umb.edu
Blomberg, S. P., T. Garland Jr., and 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, and 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. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
## load data from Garland et al. (1992)
data(mammal.tree)
data(mammal.data)
## extract characters of interest
ln.bodyMass<-log(setNames(mammal.data$bodyMass,
rownames(mammal.data)))
ln.homeRange<-log(setNames(mammal.data$homeRange,
rownames(mammal.data)))
## compute phylogenetic signal K
K.bodyMass<-phylosig(mammal.tree,ln.bodyMass,
test=TRUE)
print(K.bodyMass)
plot(K.bodyMass)
K.homeRange<-phylosig(mammal.tree,ln.homeRange,
test=TRUE)
print(K.homeRange)
plot(K.homeRange)
## compute phylogenetic signal lambda
lambda.bodyMass<-phylosig(mammal.tree,ln.bodyMass,
method="lambda",test=TRUE)
print(lambda.bodyMass)
plot(lambda.bodyMass)
lambda.homeRange<-phylosig(mammal.tree,ln.homeRange,
method="lambda",test=TRUE)
print(lambda.homeRange)
plot(lambda.homeRange)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.