3 \title{Phylogenetically Independent Orthonormal Contrasts}
5 This function computes the orthonormal contrasts using the method
6 described by Felsenstein (2008). Only a single trait can be analyzed;
7 there can be several observations per species.
10 pic.ortho(x, phy, var.contrasts = FALSE, intra = FALSE)
13 \item{x}{a numeric vector or a list of numeric vectors.}
14 \item{phy}{an object of class \code{"phylo"}.}
15 \item{var.contrasts}{logical, indicates whether the expected
16 variances of the contrasts should be returned (default to
18 \item{intra}{logical, whether to return the intraspecific contrasts.}
21 The data \code{x} can be in two forms: a vector if there is a single
22 observation for each species, or a list whose elements are vectors
23 containing the individual observations for each species. These vectors
24 may be of different lengths.
26 If \code{x} has names, its values are matched to the tip labels of
27 \code{phy}, otherwise its values are taken to be in the same order
28 than the tip labels of \code{phy}.
31 either a vector of contrasts, or a two-column matrix with the
32 contrasts in the first column and their expected variances in the
33 second column (if \code{var.contrasts = TRUE}). If the tree has node
34 labels, these are used as labels of the returned object.
36 If \code{intra = TRUE}, the attribute \code{"intra"}, a list of
37 vectors with the intraspecific contrasts or \code{NULL} for the
38 species with a one observation, is attached to the returned object.
41 Felsenstein, J. (2008) Comparative methods with sampling error and
42 within-species variation: Contrasts revisited and revised.
43 \emph{American Naturalist}, \bold{171}, 713--725.
45 \author{Emmanuel Paradis}
47 \code{\link{pic}}, \code{\link{varCompPhylip}}
51 ### a single observation per species:
54 pic.ortho(x, tr, TRUE)
55 ### different number of observations per species:
56 x <- lapply(sample(1:5, 30, TRUE), rnorm)
57 pic.ortho(x, tr, intra = TRUE)