winsor.mean: Winsorized Mean

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

The function computes a winsorized mean. Winsorization consists of recoding the top k values.

Usage

1
winsor.mean(x, k = 1, na.rm = TRUE)

Arguments

x

is the vector to be winsorized.

k

is an integer for the quantity of outlier elements that should be replaced to the computation purpose.

na.rm

A logical value indicating whether NA values should be stripped before the computations.

Details

Winsorizing a vector will produce different results than trimming it. In a trimmed estimator, the extreme values are discarded, while in a Winsorized estimator, the extreme values are instead replaced by certain percentiles (the trimmed minimum and maximum). Note that Winsorization tends to be used for one-variable situations, so it is rarely used in the multivariate sample survey situation.

Value

An object of the same type as x.

Note

Winsorization is a method most common used for one-variable situation. It is rarely used in multivariate analysis.

Author(s)

Daniel Marcelino

References

Dixon, W. J., and Yuen, K. K. (1999) Trimming and winsorization: A review. The American Statistician, 53(3), 267–269.

Wilcox, R. R. (2012) Introduction to robust estimation and hypothesis testing. Academic Press, 30-32.

Statistics Canada (2010) Survey Methods and Practices.

See Also

detail.

Examples

1
2
3
4
5
6
x <- rnorm(100)

winsor.mean(x)

# see this function in context. 
detail(x) 

SciencePo documentation built on May 2, 2019, 5:53 p.m.