Control the trimming for a distribution with outliers when
k
(half the number of outliers to be trimmed) is not an integer.
Generate a vector of random numbers from the Student's
t
distribution with degrees of freedom equal to 1. The Student's
t
distribution tends to have outliers.
Visualize the distribution using a normal probability plot.
Although the distribution is symmetric around zero, several outliers affect the mean.
Find the mean of the data.
Find the 33% trimmed mean of the data.
The 33% trimmed mean is closer to zero, which is more representative of the data. For the 33% trimmed mean,
k
is not an integer (
k = 60*(33/100)/2
gives a value of
9.9
). Therefore,
trimmean
rounds
k
to the nearest integer (
10
) by default.
Control trimming by rounding
k
down to the next smaller integer (
9
). Specify the control for trimming to
'floor'
.