% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCseqdistSE.R
\name{MCseqdistSE}
\alias{MCseqdistSE}
\title{Distance standard errors derived from sets of MC-replicated sequences}
\usage{
MCseqdistSE(
  dissrepl = "LCS",
  MCrseqdata = NULL,
  udiss = FALSE,
  full.matrix = FALSE,
  ...
)
}
\arguments{
\item{dissrepl}{list, string, or object of class \code{u.diss}. If a list, list of same length as \code{MCrseqdata}. List of dissimilarity matrices or \code{dist} objects. If a character string, a method name for computing the dissimilarities with \code{\link{MCudist}}. Can also be an object of class \code{u.diss} previously computed with \code{MCudist}.}

\item{MCrseqdata}{list of MC-replicated sequence datasets of class \code{stslist}. The last element is supposed to be the observed dataset.}

\item{udiss}{logical. When \code{dissrepl} is a distance method, should distance be computed with \code{\link{MCudist}}. See details.}

\item{full.matrix}{logical. Should dissimilarities be organized in matrix form? Default is \code{FALSE} in which case dissimilarity matrices are converted into \code{dist} objects. If \code{TRUE}, dissimilarity \code{dist} objects are converted into matrices.}

\item{...}{additional arguments passed to \code{\link{MCudist}} or \code{\link{MCdisslist}} when \code{dissrepl} is a method name.}
}
\value{
Five objects:\cr
 \code{MCmean} Mean of distance objects over replicated sets of sequences.\cr
 \code{MCsd} Standard deviation of distances over replicated sets of sequences.\cr
 In addition, when the observed distances are provided as last element of the \code{dissrepl} list:\cr
 \code{MCbias} Difference between observed distance and \code{MCmean}\cr
 \code{MCse} Standard error of individual distances.\cr
 \code{MCmse} Mean square error of individual distances.\cr
 The five objects are of class \code{dist} when \code{attr(MCrseqdata,"toref")==FALSE} and matrices otherwise.
}
\description{
Computes the mean and standard deviation of
each element of the pairwise distance matrix
across sets of MC-replicated sequences.
}
\details{
Providing \code{u.diss} distances or computing distances with \code{MCudist} may be faster and can save space when the number of unique replicated sequences is smaller than the sample size times the squared root of R, which can be checked with \code{\link{MCnunique}}. When the number of unique replicated sequences largely exceeds the threshold, it is more efficient to compute distance matrices separately for each updated set of sequences with \code{\link{MCdisslist}} or by setting \code{udiss=FALSE}.
}
\examples{
# example code
exdata <- read.table(text="
                a a b b
                a a b b
                b b a a
                a c c b
                b b a c
                b b a c
                ")
weights=rep(1, nrow(exdata))
s.exdata <- seqdef(exdata, weights = weights, id=paste("id",1:nrow(exdata), sep=""))

## 3 MC-replicated sequence datasets
altseq.list <- MCseqReplicate(s.exdata, J=1, R=3, include.obs=TRUE)
## list of dissimilarity matrices
disslist <- MCdisslist(altseq.list, method="HAM")

MCdselist <- MCseqdistSE(disslist)
print(MCdselist)

MCratioslist <- MCratios(MCdselist)
print(MCratioslist)

}
\seealso{
\code{\link{MCseqReplicate}}, \code{\link{MCdisslist}}, \code{\link{MCudist}}, \code{\link{print.distMC}}, \code{\link{summary.distMC}}
}
