This macro calculates the trimmed mean by removing the smallest p% and the largest p% of the values (rounded to the nearest integer), and then averages the remaining values.

This macro calculates the trimmed mean by removing the smallest p% and the largest p% of the values (rounded to the nearest integer), and then averages the remaining values.

Download the Macro

Be sure that Minitab knows where to find your downloaded macro. Choose File > Options > General. Under Macro location browse to the location where you save macro files.

Important

If you use an older web browser, when you click the Download button, the file may open in Quicktime, which shares the .mac file extension with Minitab macros. To save the macro, right-click the Download button and choose Save target as.

Required Inputs

  • A column of numeric data
  • The trim percentage you'd like to use.
    Note

    The percentage must be a positive value greater than 0 and less than 50%. You can specify this percentage as a decimal (10% = 0.10) or as an integer (10% = 10).

Running the Macro

Suppose the data are in C1 and you want to calculate a 10% trimmed mean. To run the macro, choose View > Command Line/History and type:

%TRIMMEAN C1 0.10

Click Run.