Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trim.mean

Trimmed mean


Description

Trimmed mean.

Usage

trim.mean(x, a = 0.05)
colTrimMean(x, a = 0.05,parallel=FALSE)
rowTrimMean(x, a = 0.05,parallel=FALSE)

Arguments

x

A numerical vector or a numerical matrix.

a

A number in (0, 1), the proportion of data to trim.

parallel

Run the algorithm parallel in C++.

Details

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.

Value

The trimmed mean.

Author(s)

Michail Tsagris and Manos Papadakis

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>

References

Wilcox R.R. (2005). Introduction to robust estimation and hypothesis testing. Academic Press.

See Also

Examples

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)

Rfast2

A Collection of Efficient and Extremely Fast R Functions II

v0.0.9
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Stefanos Fafalios and Marios Dimitriadis.
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.