Trimmed mean | R Documentation |
Trimmed mean.
trim.mean(x, a = 0.05,parallel=FALSE)
colTrimMean(x, a = 0.05,parallel=FALSE,cores=0)
## S3 method for class 'matrix'
colTrimMean(x,a = 0.05,parallel=FALSE,cores=0)
## S3 method for class 'data.frame'
colTrimMean(x,a = 0.05,parallel=FALSE,cores=0)
rowTrimMean(x, a = 0.05,parallel=FALSE,cores=0)
x |
A numerical vector or a numerical matrix or data.frame. |
a |
A number in (0, 1), the proportion of data to trim. |
parallel |
Run the algorithm parallel in C++. |
cores |
Number of cores to use for parallelism. Valid only when argument parallel is set to TRUE. Default value is 0 and it means the maximum supported cores. |
The trimmed mean is computed. The lower and upper a% of the data are removed and the mean is calculated using the rest of the data.
The trimmed mean.
Michail Tsagris and Manos Papadakis.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Manos Papadakis papadakm95@gmail.com.
Wilcox R.R. (2005). Introduction to robust estimation and hypothesis testing. Academic Press.
Quantile
x <- rnorm(100, 1, 1)
all.equal(trim.mean(x, 0.05),mean(x, 0.05))
x<-matrix(x,10,10)
colTrimMean(x,0.05)
rowTrimMean(x,0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.