Learn R Programming

phytools (version 0.2-40)

ratebystate: Method for investigating the rate of one trait as a function of the state of another

Description

This function attempts to ask if the rate of a continuous character, y, depends on the state of a separate continuous trait, x. This is accomplished by regressing the squared contrasts in y on the branch or node ancestral estimates of x.

Usage

ratebystate(tree, x, y, nsim=100, corr=c("pearson","spearman"), ...)

Arguments

tree
phylogenetic tree.
x
a continuous character - the dependent variable in the model.
y
a second continuous trait - the response variable.
nsim
number of simulations for hypothesis testing.
corr
correlation method to use. Same as in cor.
...
optional arguments which include sim.method ("fastBM" or "sim.corrs"; see fastBM and sim.corrs); method

Value

  • This function returns a list with up to the following four elements:
  • betavalue of the regression coefficient for square of the contrasts in y regressed on the ancestral or branch-wise estimated states for x.
  • rcorrelation coefficient for corr=corr.
  • corrstring giving the value of corr.
  • methodstring giving the value of method.

See Also

fastAnc, pic