Description Usage Arguments Details Value Author(s) References See Also Examples
The function orthobasis.phylo
(also nicknamed me.phylo
)
computes Moran's eigenvectors (ME) associated to a tree. If the tree has 'n'
tips, (n1) vectors will be produced. These vectors form an orthonormal
basis: they are centred to mean zero, have unit variance, and are
uncorrelated. Each vector models a different pattern of phylogenetic
autocorrelation. The first vectors are those with maximum positive
autocorrelation, while the last vectors are those with maximum negative
autocorrelation. ME can be used, for instance, as regressors to remove
phylogenetic autocorrelation from data (see references).
1 2  orthobasis.phylo(x = NULL, prox = NULL, method = c("patristic", "nNodes",
"oriAbouheif", "Abouheif", "sumDD"), f = function(x) { 1/x })

x 
A tree of class 
prox 
a matrix of phylogenetic proximities as returned by

method 
a character string (full or abbreviated without ambiguity)
specifying the method used to compute proximities; possible values are: 
f 
a function to change a distance into a proximity. 
ME can be obtained from a tree, specifying the phylogenetic proximity to be
used. Alternatively, they can be obtained directly from a matrix of
phylogenetic proximities as constructed by proxTips
.
An object of class orthobasis
. This is a data.frame with
Moran's eigenvectors in column, with special attributes:

attr(...,"values"): Moran's index for each vector  attr(...,"weights"):
weights of tips; current implementation uses only uniform weights
Thibaut Jombart tjombart@imperial.ac.uk
PeresNeto, P. (2006) A unified strategy for estimating and
controlling spatial, temporal and phylogenetic autocorrelation in ecological
models Oecologica Brasiliensis 10: 105119.
Dray, S.; Legendre, P. \& PeresNeto, P. (2006) Spatial modelling: a
comprehensive framework for principal coordinate analysis of neighbours
matrices (PCNM) Ecological Modelling 196: 483493.
Griffith, D. \& PeresNeto, P. (2006) Spatial modeling in ecology: the
flexibility of eigenfunction spatial analyses Ecology 87:
26032613.
 proxTips
which computes phylogenetic proximities
between tips.
 treePart
which can compute an orthobasis based on the
topology of a phylogeny.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46  if(require(ape) && require(phylobase)){
## SIMPLE EXAMPLE ##
## make a tree
x < rtree(50)
## compute Moran's eigenvectors
ME < me.phylo(x, met="Abouheif")
ME
## plot the 10 first vectors
obj < phylo4d(x, as.data.frame(ME[,1:10]))
table.phylo4d(obj, cex.sym=.7, cex.lab=.7)
## Not run:
## REMOVING PHYLOGENETIC AUTOCORRELATION IN A MODEL ##
## use example in ungulates dataset
data(ungulates)
tre < read.tree(text=ungulates$tre)
plot(tre)
## look at two traits
afbw < log(ungulates$tab[,1])
neonatw < log((ungulates$tab[,2]+ungulates$tab[,3])/2)
names(afbw) < tre$tip.label
names(neonatw) < tre$tip.label
plot(afbw, neonatw) # relationship between traits
lm1 < lm(neonatw~afbw)
abline(lm1)
lm1
resid1 < residuals(lm1)
orthogram(resid1, tre) # residuals are autocorrelated
## compute Moran's eigenvectors (ME)
myME < me.phylo(tre, method="Abou")
lm2 < lm(neonatw ~ myME[,1] + afbw) # use for ME as covariable
resid2 < residuals(lm2)
orthogram(resid2, tre) # there is no longer phylogenetic autocorrelation
## see the difference
table.phylo4d(phylo4d(tre, cbind.data.frame(resid1, resid2)))
## End(Not run)
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.