Statistics
Trim
trim data set
Winsorize
winsorize data set
Calling Sequence
Parameters
Description
Examples
Trim(X, l, u)
Winsorize(X, l, u)
X

data sample
l
numeric; lower percentile
u
numeric; upper percentile
The Trim and Winsorize commands can be used to eliminate extreme points in a data set.
The Trim command return all points from X between lth and uth percentiles.
The Winsorize command is similar to Trim except that the extreme points in X are replaced with the values of the lth or the uth percentile (whichever is closer).
The first parameter X is the data set, given as e.g. a Vector.
The second parameter l is the lower percentile, the third parameter u is the upper percentile. Both l and u must be numeric constants between 0 and 100. A common choice for l and u is 5 and 95 respectively.
$\mathrm{with}\left(\mathrm{Statistics}\right)\:$
$A\u2254\mathrm{Array}\left(\left[\mathrm{seq}\left(i\,i=1..10\right)\right]\right)$
${A}{\u2254}\left[\begin{array}{cccccccccc}{1}& {2}& {3}& {4}& {5}& {6}& {7}& {8}& {9}& {10}\end{array}\right]$
$\mathrm{Trim}\left(A\,25\,75\right)$
$\left[\begin{array}{c}{3}\\ {4}\\ {5}\\ {6}\\ {7}\end{array}\right]$
$\mathrm{Winsorize}\left(A\,25\,75\right)$
$\left[\begin{array}{cccccccccc}{3}& {3}& {3}& {4}& {5}& {6}& {7}& {8}& {8}& {8}\end{array}\right]$
See Also
Statistics[DataManipulation]
Download Help Document
What kind of issue would you like to report? (Optional)