]> git.donarmstrong.com Git - ape.git/blob - man/varCompPhylip.Rd
new pic.ortho() and varCompPhylip() + fix in dist.nodes()
[ape.git] / man / varCompPhylip.Rd
1 \name{varCompPhylip}
2 \alias{varCompPhylip}
3 \title{Variance Components with Orthonormal Contrasts}
4 \description{
5   This function calls Phylip's contrast program and returns the
6   phylogenetic and phenotypic variance-covariance components for one or
7   several traits. There can be several observations per species.
8 }
9 \usage{
10 varCompPhylip(x, phy, exec = NULL)
11 }
12 \arguments{
13   \item{x}{a numeric vector, a matrix (or data frame), or a list.}
14   \item{phy}{an object of class \code{"phylo"}.}
15   \item{exec}{a character string giving the name of the executable
16     contrast program (see details).}
17 }
18 \details{
19   The data \code{x} can be in several forms: (i) a numeric vector if
20   there is single trait and one observation per species; (ii) a
21   matrix or data frame if there are several traits (as columns) and a
22   single observation of each trait for each species; (iii) a list of
23   vectors if there is a single trait and several observations per
24   species; (iv) a list of matrices or data frames: same than (ii) but
25   with several traits and the rows are individuals.
26
27   If \code{x} has names, its values are matched to the tip labels of
28   \code{phy}, otherwise its values are taken to be in the same order
29   than the tip labels of \code{phy}.
30
31   Phylip (version 3.68 or higher) must be accessible on your computer. If
32   you have a Unix-like operating system, the executable name is assumed
33   to be \code{"phylip contrast"} (as in Debian); otherwise it is set
34   to \code{"contrast"}. If this doesn't suit your system, use the
35   option \code{exec} accordingly. If the executable is not in the path, you
36   may need to specify it, e.g., \code{exec = "C:/Program Files/Phylip/contrast"}.
37 }
38 \value{
39   a list with elements \code{varA} and \code{varE} with the phylogenetic
40   (additive) and phenotypic (environmental) variance-covariance
41   matrices. If a single trait is analyzed, these contains its variances.
42 }
43 \references{
44   Felsenstein, J. (2004) Phylip (Phylogeny Inference Package) version
45   3.68. Department of Genetics, University of Washington, Seattle, USA.
46   \url{http://evolution.genetics.washington.edu/phylip/phylip.html}.
47
48   Felsenstein, J. (2008) Comparative methods with sampling error and
49   within-species variation: Contrasts revisited and revised.
50   \emph{American Naturalist}, \bold{171}, 713--725.
51 }
52 \author{Emmanuel Paradis}
53 \seealso{
54   \code{\link{pic}}, \code{\link{pic.ortho}}, \code{\link{compar.lynch}}
55 }
56 \examples{
57 \dontrun{
58 tr <- rcoal(30)
59 ### Five traits, one observation per species:
60 x <- replicate(5, rTraitCont(tr, sigma = 1))
61 varCompPhylip(x, tr) # varE is small
62 x <- replicate(5, rnorm(30))
63 varCompPhylip(x, tr) # varE is large
64 ### Five traits, ten observations per species:
65 x <- replicate(30, replicate(5, rnorm(10)), simplify = FALSE)
66 varCompPhylip(x, tr)
67 }}
68 \keyword{regression}