Files
ROBITools/man/m.bivariate.Rd

55 lines
2.0 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mstat.R
\name{m.bivariate}
\alias{m.bivariate}
\title{Computes the bivariate M statistics}
\usage{
m.bivariate(w1, w2 = NULL, groups)
}
\arguments{
\item{w1}{the weigth matrix indicating the presence probability of each motu
used as focus species in each samples. Each line corresponds to a sample and each column
to a MOTU. \code{rownames} of the \code{w} matrix must be the sample
names. It is nice but not mandatory if the \code{colnames} refer to the MOTU id.}
\item{w2}{the weigth matrix indicating the presence probability of each motu
used as target species in each samples. Each line corresponds to a sample and each column
to a MOTU. \code{rownames} of the \code{w} matrix must be the sample
names. It is nice but not mandatory if the \code{colnames} refer to the MOTU id.
if \code{w2} is not set, w1 is also used as target species. in this case the diagonal
of the matrix return contains the univariate M statistic for the diferent species.}
\item{groups}{the list of considered groups as computed by the \code{\link{dist.center.group}}
function}
}
\value{
a matrix of M bivariate statistics with one focus species by row and one target species
by columns If \code{w2} is not specified the diagonal of the matrix is equal to the univariate
M statistic of the corresponding species.
}
\description{
The function computes the bivariate M statiscics for a set of target species around a set of
focus species.
}
\examples{
data(termes)
termes.ok = termes[,colSums(termes$reads)>0]
pos = expand.grid(1:3 * 10,1:7 * 10)
labels = rownames(termes.ok)
d = dist.grid(pos[,1],pos[2],labels)
groups = dist.center.group(d,20)
w = m.weight(termes.ok)
m = m.bivariate(w,groups)
}
\references{
Marcon, E., Puech, F., and Traissac, S. (2012).
Characterizing the relative spatial structure of point patterns.
International Journal of Ecology, 2012.
}
\seealso{
\code{\link{dist.center.group}}
\code{\link{m.weight}}
}