This function computes winsorized mean. The winsorization consists of recoding the top k values.
Usage
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.
Value
An object of the same type as x.
encoding
latin1
Details
Winsorizing a vector will produce different results than trimming it. By trimming a vector, the extreme values are discarded, while by Winsorizing it will replace the extreme values by certain percentiles instead.
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.