| Statistics Toolbox | Search  Help Desk |
| trimmean | Examples See Also |
Mean of a sample of data excluding extreme values.
Syntax
m = trimmean(X,percent)
Description
trimmean(X,percent) calculates the mean of a sample X excluding the highest and lowest percent/2 of the observations. The trimmed mean is a robust estimate of the location of a sample. If there are outliers in the data, the trimmed mean is a more representative estimate of the center of the body of the data. If the data is all from the same probability distribution, then the trimmed mean is less efficient than the sample average as an estimator of the location of the data.Examples
This example shows a Monte Carlo simulation of the relative efficiency of the 10% trimmed mean to the sample average for normal data.x = normrnd(0,1,100,100);
m = mean(x);
trim = trimmean(x,10);
sm = std(m);
strim = std(trim);
efficiency = (sm/strim).^2
efficiency =
0.9702
See Also
mean,median,geomean,harmmean