Learn R Programming

PHYLOGR (version 1.0.12)

matrix.D: Produce the Matrix D of Garland and Ives (2000) for GLS

Description

Produces the matrix D in Garland and Ives, 2000, p. 361, for further use in GLS procedures. You will rarely need to call this function directly. It is called by phylog.gls.fit.

Usage

matrix.D(x)

Value

A variance-covariance matrix.

Arguments

x

a phylogenetic variance-covariance matrix, such as a matrix returned from a call to read.phylog.matrix.

Author

Ramon Diaz-Uriarte and Theodore Garland, Jr.

References

Diaz-Uriarte, R., and Garland, T., Jr., in prep. PHYLOGR: an R package for the analysis of comparative data via Monte Carlo simulations and generalized least squares approaches.

Garland, T. Jr. and Ives, A. R. (2000) Using the past to predict the present: confidence intervals for regression equations in phylogenetic comparative methods. The American Naturalist, 155, 346-364.

See Also

read.phylog.matrix, phylog.gls.fit

Examples

Run this code
#perform GLS using lm function after transforming the variables
data(Lacertid.varcov)
mD <- matrix.D(Lacertid.varcov)
data(Lacertid.Original)
# obtain transformed variables
Z <- mD %*% Lacertid.Original$clutch.size
U <- mD %*% cbind(rep(1,18),Lacertid.Original$svl) # intercept included
lm1 <- lm(Z ~ U - 1) # eliminate intercept, since already included in U matrix
summary(lm1)

Run the code above in your browser using DataLab