Random data for a control chart

This macro generates random data for a control chart.

Download the Macro

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


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

  • The number of subgroups you'd like your data to have
  • Subgroup size
  • Data mean
  • Group variation
  • Subgroup variation
  • Random effects

Running the Macro

To run the macro, click anywhere in the Session window and choose Editor > Show Command Line. At the command prompt (MTB>), type the following:


Press Enter.

Enter values at each of the DATA prompts and press Enter.


Out-of-control data can be created by specifying the variation between the subgroups to be larger than the variation within the subgroups.


The macro will randomly choose to add a process shift or a trend at a random subgroup.

By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy