matrix.D {PHYLOGR} | R Documentation |
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)
Arguments
x |
a phylogenetic variance-covariance matrix, such as a matrix returned from a call to read.phylog.matrix. |
Value
A variance-covariance matrix.
Note
The file read is a dsc file generated from PDDIST under option 5 with the additional options : - in matrix form; - with header; - with scaled values.
Author(s)
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
#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)