You are on page 1of 17

ReadMe.

Txt Last updated 10/9/2007

This ReadMe contains a list of the macros downloaded from


http://www.minitab.com/support/macros and general instructions for
running the macros.
For ease-of-use, store macros for use in Release 14 of MINITAB in
\Program Files\Minitab 14\Macros and store macros for use in Release 15 in
\Program Files\Minitab 15\English\Macros. The macros are stored in text files,
which
have the extension *.MAC.
You can run the macros from either the command prompt, MTB >, in the Session
window or from the Command Line Editor. To enable the command prompt in the
Session window, click anywhere in the Session window to make it the active
window. Choose Editor > Enable Commands. To use the Command Line Editor
at any time, choose Edit > Command Line Editor.
NOTE: For instructions on permanently enabling the command prompt, see
Answer #660 in the Answers Knowledgebase:
http://www.minitab.com/support/answers/answer.aspx?ID=660

Specific directions for running the individual macros are contained near
the top of the code for each macro. For example, the macro the macro that create
s a
tolerance interval, TOLINT.MAC, contains the instructions: Suppose you want to
create a 95% tolerance interval that contains 90% of the population
represented by the data in C3. Choose Edit > Command Line Editor.
Type the following command.
%TOLINT C3
Click on the Submit Commands button.
The macros can be viewed using Microsoft Notepad. The extension .MAC
can be associated with Notepad, so that double clicking on a macro
file opens the macro in Notepad.
If you have problems running any of the macros, please contact MINITAB's
Technical Support at http://customer.minitab.com/ or email macrolib@minitab.com

****************MACROS****************

Added Variable Plots


This macro creates added variable plots in a linear regression analysis.
<ul> </ul>
File Name: AVPLOTS.MAC
*****************************
ANOM for 2 Level, 2 Factor Design
This macro creates an ANOM chart for a 2 factor, 2 level factorial design. The
interaction between the 2 factors is displayed on the same scale as the main
effects. The default decision limits are calculated at alpha = .05.
<ul> </ul>
File Name: ANOM2FACT.MAC
*****************************
Binomial CDF for Multiple Trials
This macro generates the cumulative probability of the binomial distribution
with a number of trials from one column, a number of successes from a second
column, and a given probability of success, row by row.
<ul> </ul>
File Name: BINOPROB.MAC
*****************************
Bivariate Control Chart
Uses Hotelling's T in combination with principal components analysis.
<ul> </ul>
File Name: BCC.MAC
*****************************
Blank Xbar or Individuals Control Chart
This macro creates a blank Xbar or Individuals control chart where the control
limits are based on historical information. There are two options for obtaining
the control limits: Calculate the control limits based on a historical mean and
a historical sigma or directly input the values for the historical upper and
lower control limits.
<ul> </ul>
File Name: BLANKCH.MAC
*****************************
Box-Cox Transformation for Regression and Response Surface Models
This macro determines the likelihood estimate of the Box-Cox power
transformation parameter in regression and response surface modeling
applications. A plot of the log-likelihood function over a range of parameter
values is displayed showing the likelihood estimate and an approximate 95%
confidence interval for the parameter. Also displayed is a plot of the values o
f
the PRESS statistic transformed back to the original response scale over the 95
%
confidence interval. Optionally, the user may choose to specify the range of
parameter values in the plot of PRESS, display an index plot due to Cook and
Wang (1983) showing the influence of individual cases on the likelihood
estimate, and store all computed results.
<ul> </ul>
File Name: BCTRANS.MAC
*****************************
Boxplot3
This macro creates a boxplot in which the outliers are based on 3 times the
interquartile range (instead of 1.5) and are optionally stored in the worksheet
.
<ul> </ul>
File Name: BOXPLOT3.MAC
*****************************
Box-Tidwell Procedure
This macro executes the Box-Tidwell procedure to determine appropriate predicto
r
variable power transformations for a regression model linear in the transformed
predictors. It is important to note that this procedure can be numerically
unstable resulting in error conditions for some data sets.
<ul> </ul>
File Name: BTTRANS.MAC
*****************************
Business Days
This macro stores the number of business days from one date to another.
Note: the start and end dates are included in the count, as well as holidays if
This functionality has been added to Release 15. Choose Calc > Calculator and
select the function Workdays or Net Workdays.
<ul> </ul>
File Name: BUSINESS.MAC
*****************************
Calculating Percentiles
This macro calculates user specified percentiles for a data column. You can als
o
Part of this functionality has been added to Release 15. Choose Calc >
Calculator and the function percentiles to calculate percentiles of an entire
column.
<ul> </ul>
File Name: PERCENTILE.MAC
*****************************
Calculating Quartiles using the Counting Method
This macro calculates the first and third quartiles using the counting method
found in many textbooks, as opposed to the percentile method used in Minitab.
<ul> </ul>
File Name: QRTILES.MAC
*****************************
Calibration or Inverse Regression
Obtains the point and interval estimate for a new value of X, the independent
variable in a simple regression equation, given a new determination of Y, the
dependent variable. This is referred to as the statistical calibration, or
inverse regression.
<ul> </ul>
File Name: CALIB.MAC
*****************************
Coefficient of Multiple Correlation
This macro stores the coefficient of multiple correlation for each column
regressed on the others.
<ul> </ul>
File Name: MULTCORR.MAC
*****************************
Combinations
This macro calculates the number of different combinations of size r items draw
n
from N distinct items. The r items are sampled without replacement. The number
This functionality has been added to Release 15. Choose Calc > Calculator and
select the function Combinations.
<ul> </ul>
File Name: COMBIN.MAC
*****************************
Confidence Intervals for Regression Coefficients
This macro calculates confidence intervals for coefficients from a regression
model.
<ul> </ul>
File Name: CICOEFF.MAC
*****************************
Confidence Intervals for the Mean or Median using Bootstrap Methods
This macro computes nonparametric confidence intervals on the mean and median o
f
a sample by using bootstrapping methods.
<ul> </ul>
File Name: BOOTSTRAP.MAC
*****************************
Control Charts from Summary Statistics - New Version
This macro uses summary data to make an Xbar chart and either an R chart or an
S
chart. The R/S choice is determined by whether ranges or standard deviations ar
e
These three subcommands are required: MEAN, SIZE and either STDEV or RANGE. The
arguments to MEAN, SIZE, STDEV and RANGE can either be a column containing one
value for each subgroup or a single constant that should be used for all
subgroups. Legal values for TEST are 1, 2, 3, 4, 5, 6, 7, 8. An historical
grouping column can be entered using the HPROCESS subcommand.
<ul> </ul>
File Name: QCSUMMARY.MAC
*****************************
Convert Dates to Fiscal Quarter and Year
This macro converts a date column to a column containing the fiscal quarter and
year. By default, the fiscal year begins in July.
<ul> </ul>
File Name: FISCAL.MAC
*****************************
Cronbach's Alpha
This macro calculates the value for Cronbach's alpha for the input data.
This functionality has been added to Release 15. Choose Stat > Multivariate >
Item Analysis.
<ul> </ul>
File Name: CRONY.MAC
*****************************
Cross Correlations for Multiple Pairs of Columns
This macro computes cross correlations for two or more pairs of columns.
<ul> </ul>
File Name: CCFLOOP.MAC
*****************************
Demonstration of the Central Limit Theorem
Provides a "guided tour" of the Central Limit Theorem, simulating multiple
throws of a die to demonstrate the theorem. Concepts are explained in notes in
the Session window, and graphs show the results of simulations. The theorem
states that if random samples of size n are repeatedly drawn from a population
with a finite mean, mu(y), and standard deviation, sigma(y), then when n is
large, the distribution of the sample means will be approximately normal with
mean equal to mu(y), and standard deviation equal to (sigma(y))/sqrt(n).
<ul> </ul>
File Name: CLT.MAC
*****************************
Demonstration of the Deming Funnel Experiment
Simulates the famous Deming funnel experiment which showed that an inappropriat
e
reaction to common cause variation will make matters worse. Using MINITAB's SPC
commands, the data is displayed graphically so that the performance of a proces
s
can be evaluated and a proper course of action for improvement determined.
<ul> </ul>
File Name: FUNNEL.MAC
*****************************
Demonstration of the Law of Large Numbers
Simulates the tossing of a coin a specified number of times. The accompanying
documentation discusses how to use the macro to discuss the law of large number
s
in an elementary statistics class.
<ul> </ul>
File Name: COUNTHEM.MAC
*****************************
Detecting sustained shift sizes using a CUSUM
This macro can be used along with a CUSUM chart to estimate the size of a small
,
sustained shift in a process mean. This shift size is also expressed in terms o
f
the within-subgroup sigma estimate.
<ul> </ul>
File Name: SHIFTSIZE.MAC
*****************************
Display Median, Q1, and Q3 on a Dotplot
This macro creates a dotplot for each input variable and plots the median, Q1,
and Q3. There is an option to plot the mean, and the mean +- 1 standard
deviation instead.
<ul> </ul>
File Name: DOTP.MAC
*****************************
Expanding Frequencies
This macro "untallies" data by taking a frequency table and creating from it a
single column of data.
<ul> </ul>
File Name: EXPAND.MAC
*****************************
Fitted Line Plot Through the Origin
This macro creates a fitted line plot that goes through the origin.
<ul> </ul>
File Name: ORIGIN.MAC
*****************************
Fourier Transformation
Does a Fourier transformation on a column of data.
<ul> </ul>
File Name: FOURIER.MAC
*****************************
Frequencies and Percents from Intervals Produced by a Histogram
This macro displays the intervals, frequencies, and percents from a histogram
where the user specifies the intervals.
<ul> </ul>
File Name: HBINS.MAC
*****************************
Geometric Mean
This macro calculates the geometric mean for a column of data.
This functionality has been added to Release 15. Choose Calc > Calculator and
select the function Geometric Mean.
<ul> </ul>
File Name: GMEAN.MAC
*****************************
Goodness-of-Fit Test for Discrete Data
This macro performs a Goodness-of-Fit test between observed frequencies and a
hypothesized discrete probability distribution, using both the chi-square and
likelihood-ratio (G) statistics. Exact p-values can be requested for small
sample sizes when no parameters are estimated. Otherwise, the Chi-square
approximation is used.
<ul> </ul>
File Name: GOF.MAC
*****************************
Half-Normal Plots
This macro creates half-normal plots.
In Release 15, choose Stat > DOE > Factorial > Analyze Factorial Design or Stat
> DOE > Factorial > Analyze Variability.
<ul> </ul>
File Name: HALFNORM.MAC
*****************************
Hildreth - Lu Procedure
The Hildreth - Lu procedure corrects for serial correlation (autocorrelation) i
n
regression type data.
<ul> </ul>
File Name: HILD_LU.MAC
*****************************
Kendall's Tau
This macro calculates Kendall's Tau, a nonparametric ranked correlation
statistic.
<ul> </ul>
File Name: REGTAU.MAC
*****************************
Kruskal Wallis Multiple Comparisons
The Kruskal Wallis H statistic is an overall test statistic that enables one to
test the general hypothesis that all population medians are equal. Often, the
investigator is not extremely interested in this general hypothesis but is
interested in comparisons amongst the individual groups. This macro performs
multiple comparisons in a nonparametric setting.
<ul> </ul>
File Name: KRUSMC.MAC
*****************************
Mann-Kendall Test for Detecting Trends
This macro calculates the Mann-Kendall test for detecting trends in data
collected over time. An adjustment is made for tied observations in this
non-parametric test. You must have at least 10 observations for the Normal
approximation to be appropriate.
<ul> </ul>
File Name: MKTREND.MAC
*****************************
Markov Chain 1
This macro tries to illuminate that most processes, except the most perfect
ones, have either a â rejectâ -state or one or several loops before finished. See
Answer #952 for more details.
<ul> </ul>
File Name: CHAIN.MAC
*****************************
Markov Chain 2
This macro simulates all the processes introduced in Markov Chain 1 except for
the first, trivial one (Process 1). The macro simulates jumps to the different
states according to the specified transition matrix. It is also possible to
manually change the transition matrix to run a process of oneâ s own. See Answer
#952 for more details.
<ul> </ul>
File Name: SIMFIG_1.MAC
*****************************
Markov Chain 3
This macro also simulates all the processes introduced in Markov Chain 1 except
for the first, trivial one (Process 1). The macro simulates jumps to the
different states according to the specified transition matrix and accumulates
and displays the total time and total number of visits to the different,
non-absorbing states. It is also possible to manually change the transition
matrix and the dwelling times in the different states.
See Answer #952 for more details.
<ul> </ul>
File Name: SIMFIG_2.MAC
*****************************
Markov Chain 4
This macro draws a histogram for each one of the chosen gamma distributions use
d
to simulate dwelling times. See Answer #952 for more information.
<ul> </ul>
File Name: G.MAC
*****************************
Matrix Determinant
Computes the absolute value of the determinant of a matrix.
<ul> </ul>
File Name: MATRXDET.MAC
*****************************
Mean and Standard Deviation
This macro calculates the mean and standard deviation for the first two rows,
then the first three rows, etc. of a column.
<ul> </ul>
File Name: MNSTD.MAC
*****************************
Median of Tallied Data
This macro displays the median of tallied, or tabled, data in the Session
window.
<ul> </ul>
File Name: GMED.MAC
*****************************
Median Smoother
This macro calculates a median smoother with a default span of 3. The 1st
observation of the smoothed data is the median of the 1st 3 data points (X1, X2
,
X3). The 2nd observation of the smoothed data is the median of the (X2, X3, X4)
.
The 3rd observation is the median of (X3, X4, X5)â ¦ Thus, the smoothed data
represents a moving median of the original data.
<ul> </ul>
File Name: MEDSMOOTH.MAC
*****************************
Mode for Simple Data or Grouped Data
This macro finds the mode of the input data, which can be numeric, text, or
dates. You can also supply one or two grouping variables and the macro will fin
d
the mode for each group. The grouping variables can also be text, numeric, or
dates. This functionality has been added to Stat > Basic Statistics > Display
Descriptive Statistics.
<ul> </ul>
File Name: MODE.MAC
*****************************
MSA Setup
This macro generates the data (part numbers, operators, replicates, and
This functionality has been added to Release 15. Choose Stat > Quality Tools >
Gage Study > Create Gage R&R Study Worksheet.
<ul> </ul>
File Name: MSASETUP.MAC
*****************************
Multinomial Probabilities
This macro calculates multinomial probabilities for user-specified observed
numbers and probabilites of success.
<ul> </ul>
File Name: MULTINOM.MAC
*****************************
Multiple Case Cook's Distance
This macro computes the multiple case extension of Cook's single case distance
measure. Depending on the data set size, the distance measure can be computed
for all case pairs and triplets. In addition, the distance measure can be
computed for user selected subsets of up to ten cases. Graphics produced includ
e
a plot of Cook's distance for single cases against case number, an influential
case pairs ID plot, and fixed-pair effect plots which display the effect, or
change in Cook's distance, due to adding a third case to a fixed pair of cases.
Like functionality is available for models with no constant term.
<ul> </ul>
File Name: MULTDIST.MAC
*****************************
Multiple Case Influence Analysis
This macro employs a novel backward elimination approach in searching for
influential multiple case subsets in linear regression using Cook's multiple
case distance measure.
<ul> </ul>
File Name: MULTCASE.MAC
*****************************
Multiple Comparison Tests on Proportions
This macro performs a multiple comparisons test on proportion data using Tukey'
s
honest significant difference test.
<ul> </ul>
File Name: MULTPROP.MAC
*****************************
Newton's Method for Finding Roots of Equations
This macro executes Newton's method for finding roots of equations of the form
f(x) = 0. The method converges to a root x* of the equation provided the
derivative of f(x) is bounded in a neighborhood of x* and the starting value
specified is "sufficiently close" to x*. The convergence is "quadratic."
<ul> </ul>
File Name: NEWTON.MAC
*****************************
Newton's Method for Finding Roots of Equations without User Supplied Derivative
This macro executes Newton's method for finding roots of equations of the form
f(x) = 0. The method converges to a root x* of the equation provided the
derivative of f(x) is bounded in a neighborhood of x* and the starting value
specified is "sufficiently close" to x*. The convergence is "quadratic." A
simple approximation of the 1st derivative of f(x) is used rather than the user
supplying the 1st derivative of f(x).
<ul> </ul>
File Name: DFNEWTON.MAC
*****************************
Nonlinear Regression
Performs a nonlinear regression based upon use of the Gauss-Newton method to
iteratively find solutions to the nonlinear regression normal equations.
<ul> </ul>
File Name: NONLIN.MAC
*****************************
Normal Curve with Shaded Tails
This macro draws a normal curve with shaded tails, shading the specified
proportion of area in the tails. The default behavior is to draw a standard
normal curve and shade half of the specified area in the upper tail and half in
the lower tail. Optionally, you can change the curve from the standard normal
curve to a normal curve with a specified mean and standard deviation or place
This functionality has been added to Release 15. Choose Graph > Probability
Distribution Plot.
<ul> </ul>
File Name: NCRVTAIL.MAC
*****************************
Normplot Storage
This macro stores the Anderson-Darling test statistic (A-Squared) and p-value
for the normality test in the worksheet.
<ul> </ul>
File Name: NORMPLOTSTORE.MAC
*****************************
Numerical Integration using Romberg's Method
This macro numerically approximates the definite integral of a function using
Romberg's method.
<ul> </ul>
File Name: ROMBERG.MAC
*****************************
Numerical Integration using Simpson's Rule
This macro numerically approximates the definite integral of a function using
Simpson's rule.
<ul> </ul>
File Name: SIMPSON.MAC
*****************************
Odd-Even
Store a column declaring whether each number in another column is odd or even.
<ul> </ul>
File Name: ODDEVEN.MAC
*****************************
Ogive Curves
This macro creates an ogive curve. The default settings create a cumulative
relative frequency ogive curve. There is an option to create a relative
frequency ogive curve. The input data can be raw data like 2 1 5 5 2 1 5 4 5 2
or summarized in a frequency table.
<ul> </ul>
File Name: OGIVE.MAC
*****************************
One Sample Test of the Variance
Performs a two-tailed hypothesis test for a single population variance.
This functionality has been added to Release 15 at Stat > Basic Statistics > 1
Variance
<ul> </ul>
File Name: SIGTEST.MAC
*****************************
One-way ANOVA Confidence Intervals
This macro calculates the endpoints of the confidence intervals for the means
that are given by the commands ONEWAY, AOVONEWAY, and Interval Plot.
<ul> </ul>
File Name: CIMEANS.MAC
*****************************
PIs for Forecasts Using Winters' Additive Model
This macro allows you to specify a confidence level other than 95% for the
prediction intervals for the forecasts when using Winters' Method and an
additive model is appropriate.
<ul> </ul>
File Name: WINTADD2.MAC
*****************************
PIs for Forecasts Using Winters' Multiplicative Model
This macro allows you to specify a confidence level other than 95% for the
prediction intervals for the forecasts when using Winters' Method and a
multiplicative model is appropriate.
<ul> </ul>
File Name: WINMULT2.MAC
*****************************
PRESS Statistic for Regression data using a Power Transformation
This macro computes the model fits, residuals, deleted fits, deleted (PRESS)
residuals, and the PRESS statistic in the original units of the response when a
power transformation of the response is applied in a linear regression.
<ul> </ul>
File Name: PRESS.MAC
*****************************
Principal Components Biplot
This macro creates a Principal Components Biplot.
This functionality has been added to Release 15. Choose Stat > Multivariate >
Principal Components or Stat > Multivariate > Factor Analysis.
<ul> </ul>
File Name: BIPLOT.MAC
*****************************
Random Data for a Control Chart
This macro generates random data for a control chart.
<ul> </ul>
File Name: CCDATA.MAC
*****************************
Random Data from a Negative Binomial Distribution
This macro generates random data from a negative binomial distribution.
This functionality has been added to Release 15. Choose Calc > Random Data >
Negative Binomial.
<ul> </ul>
File Name: RANDNB.MAC
*****************************
Random Normal
This macro generates a number from a normal distribution with the mean from one
column and standard deviation from another column, row by row.
<ul> </ul>
File Name: RANDNORM.MAC
*****************************
Ranks by Group
This macro stores the ranks of the data for each level of a grouping variable.
<ul> </ul>
File Name: BYRANK.MAC
*****************************
Ridge Trace Plot
Produces a ridge trace plot and a plot of RSS VS K for data in 'y' and
predictors formed into the M1 matrix. M1 and 'y' should be in "correlation
form". These plots are useful data analytic tools for ridge regression.
<ul> </ul>
File Name: RTP.MAC
*****************************
Rolling Regression
This macro performs a rolling regression, which allows you to check for changes
in the regression coefficients over time. The first iteration runs a regression
on rows 1 through k. The second iteration runs a regression on the rows 2
through k+1. The third iteration runs a regression on rows 3 through k+2 and so
on.<p></p>
<ul></ul>
There is an optional subcommand that allows you to use rows 1 through k for the
first iteration and rows 1 through k+1 for the second iteration and rows 1
through k+2 for the third iteration and so on. The data used in the regression
is anchored at row 1.
<ul> </ul>
File Name: ROLLING.MAC
*****************************
Sen's Slope
This macro calculates Sen's Slope which is a nonparametric alternative for
estimating a slope for a univariate time series. This approach involves
computing slopes for all the pairs of ordinal time points and then using the
median of these slopes as an estimate of the overall slope. Sen's slope is
insensitive to outliers and can be used to detect if there is a trend in the
data.
<ul> </ul>
File Name: SENSLOPE.MAC
*****************************
Singular Value Decomposition
Produces the singular value decomposition of the matrix, a(stored in m1), a =
u*s*v-transpose, where u (stored in m3) has orthonormal columns, v-transpose
(stored in m5) has orthonormal rows, and s (stored in m4) is a diagonal matrix
having the positive singular values in nonincreasing order on the diagonal.
<ul> </ul>
File Name: SVD.MAC
*****************************
Smooth
This macro replaces the missing values in a column using a smoothing technique
that handles missing values by assuming a linear relationship.
This macro replaces missing values in a column of data with the "average" of th
e
data around them. One missing value is replaced by the average of the
observations before and after it. Multiple missing values are replaced by
"steps" between the known values.
<ul> </ul>
File Name: SMOOTH.MAC
*****************************
Spectral Analysis
This macro provides the following tools for spectral analysis: the periodogram,
the cumulative periodogram, the estimated spectral function, and spectral model
checking. These functions are very valuable for stationary processes and provid
e
frequency analysis methods for residual and ARIMA model diagnostics.
<ul> </ul>
File Name: SPECTRAL.MAC
*****************************
Standardized Regression Coefficients
This macro calculates the standardized coefficients for simple and multiple
regression analysis.
<ul> </ul>
File Name: STCOEF.MAC
*****************************
Stratified Random Sampling
This macro generates a stratified random sample.
<ul> </ul>
File Name: STRAT.MAC
*****************************
Table
This macro produces this kind of table in the Session window:
<table>
<tr>
<td>&nbsp;</td>
<td>Results<td>
</tr>
<tr>
<td>---------</td>
<td>----------</td>
</tr>
<tr>
<td>Mean</td>
<td>0.087635</td>
</tr>
<tr>
<td>StDev</td>
<td>0.722207</td>
</tr>
<tr>
<td>---------</td>
<td>----------</td>
</tr>
</table>
File Name: TABLE.MAC
*****************************
Table of Frequencies and Percents from a default Hiistogram
This macro displays the frequency and percent of observations that fall into th
e
default bins created by histogram.
<ul> </ul>
File Name: HISTTAB.MAC
*****************************
Three-way Tests of Independence
This macro fits log-linear models to three-way classification data (a
contingency table). Likelihood-ratio tests for goodness of fit are performed fo
r
whole models and for individual terms.
<ul> </ul>
File Name: THREEWAY.MAC
*****************************
Tolerance Intervals
This macro calculates a (1-alpha)100% tolerance interval which covers at least
p*100% of the population (distribution).
<ul> </ul>
File Name: TOLINT.MAC
*****************************
Trimmed Mean
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 th
e
remaining values.
<ul> </ul>
File Name: TRIMMEAN.MAC
*****************************
Weighted Mean and Weighted Standard Deviation
This macro calculates the weighted mean and weighted standard deviation of a
column of data based on a frequency or weight column. Weights must be greater
than or equal to 0, and can be continuous or discrete (frequencies).
<ul> </ul>
File Name: WSTAT.MAC
*****************************

You might also like