windex.sim.test {windex} | R Documentation |
Tests for presence of convergent evolution (over and above that expected from Brownian motion)
Description
The P-value returned is for the null hypothesis that the calculated Wheatsheaf index is no higher than expected for traits evolving under Brownian motion (parameterised with rates of evolution and trait covariances estimated from the original traits).
Usage
windex.sim.test(dat, tree, traits, focal = dat[, 2], SE = TRUE, Nsims,
plot = TRUE, fossil = FALSE, main = "", line = 2.5, ...)
Arguments
dat |
A dataframe containing a column of 0s and 1s to denote non-focal and focal taxa respectively, and columns of trait data which you which to plot. The first column must be named 'species' and contain species names that correspond to those in the phylogenetic tree. |
tree |
Phylogenetic tree of class 'phylo' containing branch lengths. The tree should also be ultrametric. |
traits |
Column numbers (or names) for the traits for which you want to calculate a Wheatsheaf index. |
focal |
Column in the dataframe containing the focal designations. |
SE |
A logical specifying whether to standardise the traits by their standard error across species, default is |
Nsims |
Number of simulations on which to base the P-value. |
plot |
A logical indicating whether to plot the simulated distribution. If TRUE, a histogram is plotted with the calculated Wheatsheaf index and its 95% confidence interval overlayed on the histogram as a solid and dashed lines (respectively). |
fossil |
A logical specifying whether the tree contains fossil tips (i.e. is not ultrametric), in which case a different phylogenetic distance penalty based on shared branch length rather than shared time before divergence will be used instead. Note that this alternative penalty for trees containing fossils hasn't yet been rigorously tested so use cautiously, but it seems to behave as expected. |
main |
Main title for plot (defaults to no title). |
line |
Adjusts position of main title (if one is given), with lower values moving it down and higher values moving it up. |
... |
Additional arguments passed to hist() to customise the histogram (when plot=TRUE). |
Value
w |
Calculated Wheatsheaf index |
low95 |
Lower bound of 95% confidence interval for the Wheatsheaf index obtained by jackkniving |
up95 |
Upper bound of 95% confidence interval for the Wheatsheaf index obtained by jackkniving |
P |
P-value obtained from comparing observed Wheatsheaf index to simulations under Brownian motion on the phylogenetic tree |
sim.dist |
Wheatsheaf indices of simulated datasets used to calculate P-value |
Author(s)
Kevin Arbuckle
References
Arbuckle, K., Bennett, C.M. and Speed, M.P. 2014. A simple measure of the strength of convergent evolution. Methods in Ecology and Evolution 5:685 - 693.
See Also
Examples
## Not run:
data(sample.data)
data(sample.tree)
windex.sim.test(sample.data,sample.tree,traits=c("bm1","bm2"),focal=sample.data[,2],Nsims=1000,
plot=TRUE,col="light grey")
## End(Not run)