48 lines
1.6 KiB
R
48 lines
1.6 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/mstat.R
|
|
\name{m.univariate.test}
|
|
\alias{m.univariate.test}
|
|
\title{Test the significance of the M statistics by Monte-Carlo}
|
|
\usage{
|
|
m.univariate.test(w, groups, resampling = 100, alternative = "two.sided")
|
|
}
|
|
\arguments{
|
|
\item{w}{the weigth matrix indicating the presence probability of each motu
|
|
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.}
|
|
|
|
\item{groups}{the list of considered groups as computed by the \code{\link{dist.center.group}}
|
|
function}
|
|
|
|
\item{resampling}{the number of simulation to establish the null distribution}
|
|
|
|
\item{alternative}{a character value in \code{c('two.sided','less','greater')}
|
|
- two.sided : the m stat is check against the two side of the empirical
|
|
M distribution
|
|
- less : test if the M stat is lesser than the M observed in the the empirical
|
|
M distribution (exlusion hypothesis)
|
|
- greater : test if the M stat is greater than the M observed in the the empirical
|
|
M distribution (aggregation hypothesis)}
|
|
}
|
|
\value{
|
|
a vector of p.value with an attribute \code{m.stat} containing the actual M stat
|
|
for each MOTUs
|
|
}
|
|
\description{
|
|
Computes computes the p.value the M statistics asociated to a MOTU
|
|
by shuffling MOTUs among location.
|
|
}
|
|
\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)
|
|
pval = m.univariate.test(w,groups)
|
|
|
|
}
|