Phylogenetic size-correction via GLS regression

Description

This function fits one or multiple phylogenetic regressions (depending on the number of columns in Y) and computes the residuals. Designed for phylogenetic size correction using GLS regression (e.g., Revell 2009; Evolution).

Usage

1
phyl.resid(tree, x, Y, method="BM")

Arguments

tree

a phylogenetic tree in "phylo" format.

x

vector containing the single independent variable (e.g., size), or matrix with multiple independent variables in columns.

Y

vector or matrix with one or multiple dependent variables in columns.

method

method to obtain the correlation structure: can be "BM" or "lambda".

Details

Optionally fits λ for each regression model. Likelihood optimization of λ is performed for method="lambda" using optimize on the interval (0,1). This function is redundant with residuals(gls(...,correlation=corPagel(...))), but some users may find this method simpler, and it provides a good way to cross-check your results & make sure that you are using gls correctly.

Value

A list with the following components:

beta

a vector or matrix of regression coefficients.

resid

a vector or matrix of residuals for species.

lambda

a vector of lambda values (method="lambda" only).

logL

a vector of log-likelihoods (method="lambda" only).

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2009) Size-correction and principal components for interspecific comparative studies. Evolution, 63, 3258-3268.

Revell, L. J. (2010) Phylogenetic signal and linear regression on species data. Methods in Ecology and Evolution, 1, 319-329.

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

phyl.pca, gls

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.