Mathews Malnar and Bailey,
Inc. Quality engineering, applied statistical consulting, and training services for R&D, product, process, and manufacturing engineering organizations. |

This page provides links to text files containing MINITAB macros. Open the files in NotePad to see the code, a description of the macro, and an example calling statement.

The macros are of both LOCAL (

Some of these macros are redundant to built-in commands in MINITAB; however, many of those were written before they were supported by the program and have features that are different or code that might be of interest for other purposes.

*RepeatRows.mac*- Duplicates each row of the specified columns the specified number of times. Overwrites the original columns.*SetAColumn.mac*- Duplicates each row of a column the specified number of times and the whole sequence a specific number of time. Reproduces the functionality of the**Calc> Make Patterned Data> Arbitrary Set of Numbers**or**set**command for a column.

*FindUnique.mac*- Removes rows with consecutive duplicate values in a specified column. Overwrites the original columns.*IsOneOf.mac*- Checks every observation in a column to see if it matches a value in another column.*RowOf.mac*- Finds the row containing the minimum and maximum value in the column.*SortIntoBins.mac*- Identifies bins for observations based on bin class marks.*SplitText.mac*- Like the VB function**split()**- splits a text column by a character delimiter and writes the results to output columns.*ChangeCase.mac*- Changes entries in text columns from lower to upper case. MINITAB's**upper**function does this but only on one column at a time. The**ToLower**subcommand changes text from upper to lower case.

*HalfNorm.mac*- Creates a probability plot for half-normal, aka folded-normal data.*CircNorm.mac*- Create a probability plot for circular-normal data.*DefectivesOC.mac*- Creates an operating characteristic curve for the single sampling plan for attributes using the specified sample size and acceptance number. The function of this macro is now supported in**Stat> Quality Tools> Acceptance Sampling by Attributes> Compare User Defined Sampling Plans**but the code may still be of interest.*ROC.mac*- Creates the receiver operating characteristic curve (ROC) curve with AUC value for a binary diagnostic test.

*FitFinder.mac*- Creates a 6x6 matrix of scatterplots using common mathematical transformations applied to the x and y axes. The transformations used are: untransformed, square root, square, log, power, and reciprocal. Used to find transforms to x and/or y that linearize a nonlinear scatterplot when the first principles model is unknown.*MakeCRD.mac*- Creates the worksheet for a completely randomized design with the specified number of factor levels and replicates. Runs one-way ANOVA on the random order to confirm if the randomization was effective.

*MakeRBD.mac*- Creates the worksheet for a randomized block design with the specified number of levels of the study variable and blocks.

*Correlate.mac*- Creates the correlation matrix of all of the specified columns, their two-factor interactions, and quadratic terms for up to 12 variables. Used to validate an experiment design/run matrix or to determine the consequences when a design is compromised because of missing runs, extra runs, or just bad design.*Fold.mac*- Folds a two-level experiment design on all columns. Consider using**Stat> DOE> Modify Design**instead.*RandomizeWithinBlocks.mac*- Creates a column for the random run order for runs within blocks.

*Power.mac*- Calculates the power for the balanced fixed-effects full factorial design with optional graphs. This macro's capabilities are duplicated in**Stat> Power and Sample Size> General Full Factorial Design**; however, the macro is more flexible in its use.*OneSidedUpperCIforProportionSampleSize.mac*- Calculates the sample size required to demonstrate that a proportion is less than a specified upper limit with specified confidence level.

- Power for Fisher's Exact Test:

*FishersPower.mac*- Calculates the power for Fisher's Exact Test using the one-sided test method.*FishersPowerSlow.mac*- Calculates the power for Fisher's Exact Test using the one-sided test method. Uses two different methods to complete the calculations - one fast but complicated and the other VERY slow but easier to understand. Study this macro to understand the calculations. Use*FishersPower.mac*to get the job done.*FishersConditionalPower.mac*- Calculates the power for Fisher's Exact Test (one-sided) and the conditional power given interim results.

*TwoSamplePoissonPower.mac*- Calculates the power for the two-sample Poisson count problem. Consider using or checking this macro's result with (V17)**Stat> Power and Sample Size> 2-Sample Poisson Rate**.

*GRRS**im.mac*- Creates simulated data for a gage error study using the common operator by part crossed design. The operator controls how many operators, parts, and trials are used and EV, AV, and PV values can be set with subcommands.*Sim3.mtb*- Creates simulated response data for a three variable experiment design, e.g. two-level factorial with or without centers and response surface designs.*Sim5.mtb*- Creates simulated response data for a five variable experiment design.*RunRuleExercise.mac*- This macro creates a series of control charts with one point added to each chart. Minimize the Session window, maximize the last graph created, and then delete each graph while watching for the process to go out of control.

Return to MM&B Inc. Home Page