MedCalc  # Calculation of Trimmed Mean, SE and confidence interval

The k-times trimmed mean is calculated as the mean of the sample after the k smallest and k largest observations are deleted from the sample.

If the number of observations to be trimmed is specified as a percentage p, then p is taken as the total percentage of observations to be trimmed and k=(np/100)/2. If for example the percentage is 10%, then MedCalc trims 5% at the low side and 5% at the high side.

If k is not an integer number, it is truncated to the largest smaller integer (rounded down). Note that also SPSS, R and Excel round down, but SAS rounds up.

The k-times trimmed mean is calculated as $$\bar{x}_{tk} = \frac{1} {n-2k} \sum_{i=k+1}^{n-k}{x_i}$$

The Standard Error of the trimmed mean is based on the Winsorized mean and Winsorized sum of squared deviations (Tukey & McLauglin, 1963). The Winsorized mean is calculated as $$\bar{x}_{wk} = \frac{1}{n} \left( (k+1) x_{k+1} + \sum_{i=k+2}^{n-k-1}{x_i} + (k+1) x_{n-k} \right)$$

and the Winsorized sum of squared deviations is calculated as $$s^{2}_{wk} = (k+1) {(x_{k+1} - \bar{x}_{wk})}^2 + \sum_{i=k+2}^{n-k-1}{({x_i}-\bar{x}_{wk})}^2 + (k+1) {(x_{n-k} - \bar{x}_{wk})}^2$$

The Standard Error of the trimmed mean can then be calculated as $$\text{SE}(\bar{x}_{tk}) = \frac{s_{wk}}{\sqrt{(n-2k)(n-2k-1)} }$$

The confidence interval for the trimmed mean is defined as $$\bar{x}_{tk} \pm t_{(1- \frac{\alpha}{2}, n-2k-1)} \text{SE}(\bar{x}_{tk})$$

## References

• Tukey JM, McLaughlin DH (1963) Less Vulnerable Confidence and Significance Procedures for Location Based on a Single Sample: Trimming/Winsorization 1. Sankhya A, 25:331–352.