]> git.donarmstrong.com Git - ape.git/blob - man/pic.ortho.Rd
small moification on man page of as.phylo
[ape.git] / man / pic.ortho.Rd
1 \name{pic.ortho}
2 \alias{pic.ortho}
3 \title{Phylogenetically Independent Orthonormal Contrasts}
4 \description{
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.
8 }
9 \usage{
10 pic.ortho(x, phy, var.contrasts = FALSE, intra = FALSE)
11 }
12 \arguments{
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
17     \code{FALSE}).}
18   \item{intra}{logical, whether to return the intraspecific contrasts.}
19 }
20 \details{
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.
25
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}.
29 }
30 \value{
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.
35
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.
39 }
40 \references{
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.
44 }
45 \author{Emmanuel Paradis}
46 \seealso{
47   \code{\link{pic}}, \code{\link{varCompPhylip}}
48 }
49 \examples{
50 tr <- rcoal(30)
51 ### a single observation per species:
52 x <- rTraitCont(tr)
53 pic.ortho(x, tr)
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)
58 }
59 \keyword{regression}