\name{multiecdf} \alias{multiecdf} \alias{multiecdf.default} \alias{multiecdf.formula} \alias{multiecdf.matrix} \alias{multidensity} \alias{multidensity.default} \alias{multidensity.formula} \alias{multidensity.matrix} \title{Multiple empirical cumulative distribution functions (ecdf) and densities} \description{Plot multiple empirical cumulative distribution functions (ecdf) and densities with user interface similar to that of \code{\link{boxplot}}.} \usage{ multiecdf(x, \dots) \method{multiecdf}{formula}(formula, data = NULL, xlab, na.action = NULL, \dots) \method{multiecdf}{matrix}(x, xlab, ...) \method{multiecdf}{default}(x, xlim, col=brewer.pal(9, "Set1"), main="multiecdf", xlab, do.points=FALSE, subsample=TRUE, \dots) multidensity(x, \dots) \method{multidensity}{formula}(formula, data = NULL, xlab, na.action = NULL, \dots) \method{multidensity}{matrix}(x, xlab, ...) \method{multidensity}{default}(x, bw="nrd0", xlim, ylim, col = brewer.pal(9, "Set1"), main = "multidensity", xlab, lty = 1L , \dots) } \arguments{ \item{formula}{a formula, such as \code{y ~ grp}, where \code{y} is a numeric vector of data values to be split into groups according to the grouping variable \code{grp} (usually a factor).} \item{data}{a data.frame (or list) from which the variables in \code{formula} should be taken.} \item{na.action}{a function which indicates what should happen when the data contain \code{NA}s. The default is to ignore missing values in either the response or the group.} \item{x}{a list of numeric vectors.} \item{bw}{the smoothing bandwidth, see the manual page for \code{\link{density}}. If \code{bw} is a character string specifying a rule to choose the bandwidth, this rule is applied to \code{x[[1]]} and then the same numerical value of \code{bw} is used throughout.} \item{xlim}{Range of the x axis. If missing, the data range is used.} \item{ylim}{Range of the y axis. If missing, the range of the density estimates is used.} \item{col, lty}{Line colors and line type.} \item{main}{Plot title.} \item{xlab}{x-axis label.} \item{do.points}{logical; if \code{TRUE}, also draw points at the knot locations.} \item{subsample}{logical; if \code{TRUE}, subsamples of size 1000 are used to compute and plot the ecdf for list items with many observations (\code{>1000})} \item{...}{Further arguments that get passed on to the \code{plot} functions.} } \seealso{ \code{\link[graphics::boxplot]{boxplot}}, \code{\link[stats::ecdf]{ecdf}} \code{\link[stats::density]{density}} } \details{The usefulness of \code{multidensity} can vary, depending on the data and because of smoothing artifacts. \code{multiecdf} will in many cases be preferable.} \value{For the \code{multidensity} functions, a list of \code{\link{density}} objects.} \author{Wolfgang Huber \url{http://www.ebi.ac.uk/huber}} \examples{ f = 1 + (runif(1000)>0.5) x = rnorm(length(f), mean=f, sd=f) multiecdf(x~f) multidensity(x~f) } \keyword{hplot}