Skip to contents

Trimming discards extreme observations; winsorizing caps them. The difference matters for the variance: the winsorized sample still has n observations, so the estimator has a smaller standard error than the trimmed mean at the same alpha.

Usage

Winz(x, alpha = 0.1)

Arguments

x

Sample.

alpha

Fraction winsorized at each tail.

Value

List with estimate, lower, upper, n_changed, n.

Details

Formula: replace values below the alpha quantile with it and above the 1 - alpha quantile with that, then take the mean.

References

Dixon, W. J. (1960). Ann Math Statist 31:385-391, where Winsor rule is set out and attributed to him.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Winz(V)
#> $estimate
#> [1] 4.5
#> 
#> $lower
#> [1] 1.7
#> 
#> $upper
#> [1] 7.3
#> 
#> $n_changed
#> [1] 2
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Winsorized mean"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"