tmean: Modified Band Depth-Based Alpha Trimmed Mean

Description Usage Arguments Details Value Author(s) Examples

View source: R/tmean.R

Description

tmean computes the mean of the deepest observations within the sample, their depths given by the Modified Band Depth, trimming out the proportion alpha of the outest observations.

Usage

1
tmean(x,alpha=0.2,plotting=FALSE,new=TRUE,cols=c(1,4,8),...)

Arguments

x

an nxd data matrix containing the observations (samples) by rows and the variables (genes) by columns

alpha

the proportion of observations that are trimmed out when computing the mean. 0.2 by default.

plotting

a logical value. If TRUE then a plot is built. If alpha has length 1, then the trimmed mean, the samples used for its computation and the discarded ones are plotted with different colors, according to the values of cols, below. If alpha has length greater than 1, then a plot with several trimmed means is constructed. The first element in cols is used to determine a color palette, from cols[1] (for the smallest value in alpha) to 'gray' (for the greatest value in alpha).

new

a logical value. If alpha has length 1 or plotting is FALSE, then it is ignored. If TRUE, a new plot is started; otherwise, the new trimmed means are added to the existing plot.

cols

a vector of length 3 containing, in the following ordering, the colors for depicting the trimmed mean, the trimmed collection of samples and the samples which are not taken into account in the computation of the trimmed mean.

...

graphical parameters (see 'par') and any further arguments of 'plot'.

Details

The rows of matrix x, corresponding to genes, are ordered from center outward, that is, starting with the deepest one(s) and ending with the less deep one(s), according to MBD. The alpha-trimmed mean is computed by first removing the proportion alpha of less deep points, and then computing the component-wise average of the remaining observations.

Value

tm

the alpha-trimmed mean vector of length p of matrix x

tm.x

the deespest points of x after removing the proportion alpha of less deep points

Author(s)

Sara Lopez-Pintado sl2929@columbia.edu and

Aurora Torrente etorrent@est-econ.uc3m.es

Examples

1
2
3
4
5
6
  set.seed(50)
  x <- matrix(rnorm(100),10,10)
  m.x<-apply(x,2,mean)
  t.x<-tmean(x,plotting=TRUE, lty=1)

  t.x.seq <- tmean(x,alpha=c(0,0.25,0.5,0.75),plotting=TRUE, lty=1, cols=2)

depthTools documentation built on May 24, 2021, 9:06 a.m.

Related to tmean in depthTools...