The function compRates is an adaptation of search.shift which performs pairwise comparison of average absolute rates between clades via bootstrap.
compRates(RR,node, nrep =1000, cov =NULL)
Arguments
RR: an object fitted by the function RRphylo.
node: the most recent common ancestors of clades to be tested. The nodes must be identified on the dicothomized version of the original tree returned by RRphylo. Pairwise comparison between all clades is performed.
nrep: the number of simulations to be performed for the rate shift test, by default nrep is set at 1000.
cov: the covariate vector to be indicated if its effect on rate values must be accounted for. Contrary to RRphylo, cov needs to be as long as the number of tips of the tree.
Returns
For each node pair, the function returns the average absolute rate difference (computed as the difference between the average absolute rate over all branches subtended by the nodes) and related significance level. Probabilities are derived by contrasting the rate differences to simulated ones derived by shuffling the rates across the tree branches for a number of replicates specified by the argument nrep. Note that the p-values refer to the number of times the real differences are larger (p-value>=0.975) or smaller (p-value<=0.025) than the simulated ones, divided by the number of simulations, hence the test should be considered as two-tailed. The output always has an attribute "Call" which returns an unevaluated call to the function.