compRates: Comparing average absolute rates between clades

View source: R/compRates.R

compRatesR Documentation

Comparing average absolute rates between clades

Description

The function compRates is an adaptation of search.shift which performs pairwise comparison of average absolute rates between clades via bootstrap.

Usage

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.

Value

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.

Author(s)

Silvia Castiglione, Giorgia Girardi

See Also

search.shift vignette

Examples

## Not run: 
data("DataOrnithodirans")
DataOrnithodirans$treedino->treedino
DataOrnithodirans$massdino->massdino
DataOrnithodirans$statedino->statedino
cc<- 2/parallel::detectCores()

RRphylo(tree=treedino,y=massdino,clus=cc)->dinoRates
compRates(RR=dinoRates,node=c(696,746))->cr1
compRates(RR=dinoRates,node=c(696,746),cov=massdino)->cr2
    
## End(Not run)

RRphylo documentation built on April 3, 2025, 9:43 p.m.