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

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/PHYLOGR.R

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

1

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

1
2
3
4
5
6
7
8
9
#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)

rdiaz02/PHYLOGR documentation built on April 22, 2020, 11:41 p.m.