Description Usage Arguments Details Value Note Author(s) References See Also Examples
The function computes a winsorized mean. Winsorization consists of recoding the top k values.
1 | winsor.mean(x, k = 1, na.rm = TRUE)
|
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. |
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.
An object of the same type as x
.
Winsorization is a method most common used for one-variable situation. It is rarely used in multivariate analysis.
Daniel Marcelino
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.
1 2 3 4 5 6 | x <- rnorm(100)
winsor.mean(x)
# see this function in context.
detail(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.