3 \title{Moran's I Autocorrelation Index}
5 Moran.I(x, weight, scaled = FALSE, na.rm = FALSE,
6 alternative = "two.sided")
9 \item{x}{a numeric vector.}
10 \item{weight}{a matrix of weights.}
11 \item{scaled}{a logical indicating whether the coefficient should be
12 scaled so that it varies between -1 and +1 (default to
14 \item{na.rm}{a logical indicating whether missing values should be
16 \item{alternative}{a character string specifying the alternative
17 hypothesis that is tested against the null hypothesis of no
18 phylogenetic correlation; must be of one "two.sided", "less", or
19 "greater", or any unambiguous abbrevation of these.}
22 This function computes Moran's I autocorrelation coefficient of
23 \code{x} giving a matrix of weights using the method described by
24 Gittleman and Kot (1990).
27 The matrix \code{weight} is used as ``neighbourhood'' weights, and
28 Moran's I coefficient is computed using the formula:
29 \deqn{I = \frac{n}{S_0} \frac{\sum_{i=1}^n\sum_{j=1}^n w_{i,j}(y_i -
30 \overline{y})(y_j - \overline{y})}{\sum_{i=1}^n {(y_i -
31 \overline{y})}^2}}{\code{I = n/S0 * (sum\{i=1..n\} sum\{j=1..n\} wij(yi - ym))(yj - ym)
32 / (sum\{i=1..n\} (yi - ym)^2)}}
35 \item \eqn{y_i}{yi} = observations
36 \item \eqn{w_{i,j}}{wij} = distance weight
37 \item \eqn{n} = number of observations
38 \item \eqn{S_0}{S0} = \eqn{\sum_{i=1}^n\sum_{j=1}^n wij}{\code{sum_{i=1..n} sum{j=1..n} wij}}
41 The null hypothesis of no phylogenetic correlation is tested assuming
42 normality of I under this null hypothesis. If the observed value
43 of I is significantly greater than the expected value, then the values
44 of \code{x} are positively autocorrelated, whereas if Iobserved <
45 Iexpected, this will indicate negative autocorrelation.
48 A list containing the elements:
50 \item{observed}{the computed Moran's I.}
51 \item{expected}{the expected value of I under the null hypothesis.}
52 \item{sd}{the standard deviation of I under the null hypothesis.}
53 \item{p.value}{the P-value of the test of the null hypothesis against
54 the alternative hypothesis specified in \code{alternative}.}
57 Gittleman, J. L. and Kot, M. (1990) Adaptation: statistics and a null
58 model for estimating phylogenetic effects. \emph{Systematic Zoology},
61 \author{Julien Dutheil \email{julien.dutheil@univ-montp2.fr} and
64 \code{\link{weight.taxo}}
69 ## weights w[i,j] = 1/d[i,j]:
71 ## set the diagonal w[i,i] = 0 (instead of Inf...):
74 Moran.I(x, w, alt = "l")
75 Moran.I(x, w, alt = "g")
76 Moran.I(x, w, scaled = TRUE) # usualy the same