This macro calculates user-specified percentiles for a data column. You can also use a "By" variable to calculate the percentiles for groups.

Part of this feature exists in Minitab 16. Choose Calc > Calculator and the function percentiles to calculate percentiles of an entire column.

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. You may also specify a column of grouping values to calculate percentiles for each group level.
  • A column of percentages, or a single constant percent value
  • An empty column to store the results

Running the Macro

Suppose the data are in C1, the percentages are in C2, and you want the percentiles stored in C10. To run the macro, choose View > Command Line/History and type:

%PERCENTILE C1 C2 C10

Click Run.

Note

to specify a constant percentage value, just enter this value instead of a column.

Suppose that the data are n C1, the column of percentages is stored in C2, and the By variable (or grouping variable)is in C3. Because the grouping variable has three levels, you need to specify three columns to store the percentiles; say C10, C11, and C12. To run the macro, choose View > Command Line/History and type:

%PERCENTILE C1 C2 C10-C12;
BY C3.

Click Run.