Macroevolutionary hypotheses about correlates of species richness require testing in a phylogenetic framework in order to avoid phylogenetic autocorrelation. Independent contrasts as described by Felsenstein (1985) are appropriate for explanatory variables in such models but not for species richness as the response variable. This function implements two methods for calculating species richness constrasts described by Agapow and Isaac (2002) and originally implemented in the program MacroCAIC.
macrocaic(formula, data, phy, names.col, macroMethod = "RRD",
stand.contr = TRUE, robust=Inf, ref.var = NULL, node.depth = NULL,
macroMinSize = 3, equal.branch.length = FALSE)
A object of class 'caic'.
A formula describing a linear model predicting species richness.
A data frame containing the variables to be used in the model.
An object of class 'phylo'.
A name identifying a column in data
that contains the tip labels from phy
.
One of either "RRD" or "PDI" (see Details).
A logical flag indicating whether to standardize the contrasts.
A threshold value of studentized residuals to exclude from the model.
Identifies a predictor variable used for determining the direction of contrasts.
A positive integer greater than 1 used to restrict the model to contrasts with a node depth less than or equal to the specified depth. Tips have a depth of 1.
A positive integer giving the minimum species richness at a node for contrasts to be included in the model.
If set to 'TRUE' then all branch lengths are set to 2.
David Orme
The 'macrocaic' function fits a regression to the formula provided using 'crunch' contrasts for continuous explanatory variables and species richness contrasts for the response. The species richness contrasts are either the relative rate difference (RRD) or proportion dominance index (PDI):
$$RRD = \ln\left(\frac{N_1}{N_2}\right)$$ RRD = ln(N_1/N_2)
$$PDI = \left(\frac{N_1}{N_1+N_2}\right)-0.5$$ PDI = (N_1/(N_1 + N_2))-0.5
The values \(N_1\) and \(N_2\) are the species richness of the two daughter nodes and \(N_1\) is the species richness of the clade with the larger value of the reference variable. Species richness contrasts are not calculated at polytomies. Nodal values for species richness are calculated as the sum of the richness of the daughter nodes.
Felsenstein, J. (1985). Phylogenies and the comparative method. Am. Nat. 125, 1-15 Agapow, P.-M. and Isaac, N. J. B. (2002) MacroCAIC: correlates of species richness. Diversity & Distributions, 8, 41-43 Isaac, N., Agapow, P., Harvey, P., and Purvis, A. (2003). Phylogenetically nested com- parisons for testing correlates of species richness: A simulation study of continuous variables. Evolution, 57(1):18-26.
caic-class
for 'caic' object structure and methods.
data(IsaacEtAl)
primates <- comparative.data(primates.tree, primates.data, binomial, na.omit=FALSE)
primatesBodySize <- macrocaic(species.rich ~ body.mass, data=primates)
summary(primatesBodySize)
Run the code above in your browser using DataLab