Introduction to MINITAB

October 1991

Introduction to MINITAB

This is an introductory guide to MINITAB, an easy-to-use interactive general purpose statistics package on the VAX/VMS system. It is a set of procedures which stores, transforms and analyzes data. The most commonly used inferential and exploratory analytic procedures are included in this package, although it is somewhat limited in advanced statistics. Currently, the University of Washington is running MINITAB Release 7.2. MINITAB has an extensive online Help facility which may be accessed by typing help at the MINITAB prompt. For more extensive information on MINITAB, see the MINITAB Reference Manual (1989), MINITAB Handbook (1985) or the MINITAB Primer. Additional help is available by contacting Minitab's Technical Services Department at (814) 238-3280.

MINITAB Structure

MINITAB performs statistical procedures on data stored as worksheets (.mtw). The worksheet format resembles a data matrix, containing a different case in each row and a different variable in each column. Columns may be added to the worksheet directly using the read or set command or they may result from manipulating already existing variables to create new variables via data transformation and data analysis. For example, to add a column directly at the MINITAB prompt (MTB>), type Read C1 C2. To add a column through data manipulation at the MTB> Let C3=C1 +C2. This operation defines C3 as the total of C1 + C2.

The data is stored in the following manner:

Variables

Case #

C1

C2

C3

C4

1

2

6

55

4

2

4

6

22

9

3

2

55

9

0

*

*

n

4

2

78

6

 

When you request information on your data to be shown on the screen, it will also appear in this format. Worksheets are storage files written in MINITAB's own machine language which are only meaningful when edited within MINITAB. The worksheets can, however, be saved as permanent files to be used in future MINITAB sessions. In addition, some or all of the data contained in the worksheet may be written into an "output file" which is written in normal characters. This "output file", sometimes known as a "raw data file", can then be read by other programs or printed.

IMPORTANT In order to have printed output of your work session, you must tell MINITAB this at the beginning of your session. (For information on this see the "Saving MINITAB Work" section of this document).

MINITAB Worksheets on the VAX may contain up to 1000 columns (variables) and stored constants, and up to 100 saved matrices.

MINITAB Syntax

All commands in MINITAB begin on a single line with a four letter command name. Whenever the command name is longer than four letters, only the first four letters of the word need to be used. For example "retrieve" may be abbreviated as "retr". For clarity, commands in this document will be written in full with those letters which must be utilized for MINITAB to recognize capitalized. Most of the command names may then be modified by including additional parameters and specifications which tailor the command to your data set and procedures. For each command procedure, you must define which columns (variables) you wish to use. With some commands, you need to insert optional specifications in addition to the command name. If a single command line requires more than one line to enter, all lines but the last should end with an ampersand, or & symbol. When you utilize an &, the next prompt you receive will be CONT>. A command line may look like the following:

MTB>READ C1 C2 C3

This command tells MINITAB you are now going to enter data into these three columns.

Notation:

C

Denotes a variable--written either as columns (C1, C12) or as names ('sex', 'age').

K

Denotes a constant--written either as a stored constant or as a number (3.54).

E

Denotes either a variable or a constant.

M

Denotes a matrix.

[ ]

Encloses an optional argument.

 

Some MINITAB commands have subcommands that can be utilized. Each subcommand must have its own line. A command consisting of one command line and several subcommand line should have a semicolon (; symbol) after each command line with the last line ending in a period. For example:

MTB>TABLe C1 by C2;

SUBC>MEANs C1;

SUBC>STDEV C2.

(If you forget to add the period after the final subcommand, simply type it on the next line and hit <return>.)

The elements on a command line are separated by spaces or commas. Any text on the line that MINITAB does not recognize will be ignored. This feature allows you to insert explanatory notes to yourself. For instance, the next two commands are synonymous:

MTB>READ the following data into C1 and C2

MTB>READ C1 C2

This feature may be especially helpful to users unfamiliar with the system.

MINITAB variables are usually referred to by their column numbers (C1, C2) but the terms "column" or "variable" may be used interchangeably in actual usage or conceptualization. The variables may be named and the names can be used in the command sequence in place of column numbers.

If you use variable names, always enclose them in single quotes, as in:

MTB> NAME C1 'Temp' C2 'Yield'

MTB> READ 'Temp' 'Yield'

MINITAB Constants are generally referred to as K1, K2, K3 (up to a maximum or 1000). The total number of stored constants is equal to the number of columns. Constants are not stored in the worksheets as Ks, so if you wish to retain constants in the worksheet for future sessions, they need to be stored in columns. These columns are then known as "artificially long" columns; the value appearing in the constant column is the same for every case. A possible use of a constant might be:

MTB>LET K1=100

MTB>Add K1 to C1 put into C3

In this instance, MINITAB will add 100 to each value in C1 and put the total in C3.

Entering and Leaving MINITAB

Below are commands that allow you to begin and end MINITAB sessions.

Prompt

Command

Results

$ (VAX)

MINITAB

This command starts MINITAB

MTB>

MINITAB commands

This is the MINITAB prompt. You may now start entering commands.

MTB>

STOP

MINITAB stops and returns you to the VAX prompt.

 

Saving Your Work in MINITAB

If you want to save your MINITAB worksheets (filename.mtx), when you being do the following:

Prompt

Command

Results

MTB>

Save 'file name'

MINITAB will SAVE the file name worksheet as a permanent file on your account. Failure to save your file results in the loss of your permanent worksheet upon exit.

MTB>

RETReive 'file name'

Retrieves a file that is stored on your account or available as a local file.

 

To print out your work, you must enter the OUTFILE command. MINITAB will then record your results to an outfile. The OUTFILE command will divert the session or the output to a VAX file with a .lis extension. You may use this command at the beginning of a session or whenever you wish to save your results. After you exit MINITAB, you can then print your file to one of the campus printers.

Prompt

Command

Results

MTB>

OUTFile 'filename'

This command will cause all the output from this point on to be written to a permanent file under the name you have specified. If you do not give an extension, MINITAB will add lis to the file name.

MTB>

NOOUtfile

This stops the recording of your work. Do this only after you are sure you have issued all the commands for which you need output.

MTB>

STOP

Exit from MINITAB

$

Prt filename./q=CSSCR2

Prints your file at CSSCR.

 

To keep a record of your MINITAB commands in a printable file, type JOURnal 'file name' at the MTB>. (The name you give your command file should be enclosed in single quotes.) When you are finished, type NOJOurnal. This file will appear in your directory under the name you designated with an .tj extension. This file can then be used to check command accuracy or replicate previous work.

Accessing Help and Information in MINITAB

MINITAB has an extensive on line help system. To access help:

Prompt

Command

Results

MTB>

HELP HELP

This command gives you a listing of the categories available in help.

MTB>

HELP command

Use this command when you know the name of the command you need. Subcommands may also be added for more detailed information.

You are automatically returned to the MINITAB prompt when no more information is available on the topic you requested. A useful feature of the MINITAB system is the listing of statistical test available for analysis. This listing includes examples and a brief description of each test.

MTB>

INFO

This command gives you information on your worksheet including column name, constants used and number of cases per column. It will indicate columns containing character data by displaying an "A" in front of each column number.

MTB>

PRINt C1…..Cn

This command prints to the screen the contents of each column you request.

 

Entering Data Directly into MINITAB

To enter data directly into MINITAB, use the READ or SET command. READ expects data one row at a time; SET expects dat one column at a time.

Prompt

Command

Results

MTB>

READ Cn…Cn

This command tells MINITAB that the data are to be stored in columns Cn to Cn.

DATA>

Entered here

Data is entered one case per line, with at least one space or comma between each variable. If two or more lines are needed to complete the case, all lines except the last for that case must end with an &. DO NOT ENTER CHARACTER DATA AND NUMERIC DATA IN THE SAME COLUMN.

DATA>

END

This command tells MINITAB you are finished entering data. You will then be returned to the MTB prompt.

 

 The entire sequence would look like this:

MTB>READ C1 C2

DATA> 2 4

DATA> 21 30

DATA> END

If you issued the INFO command to see your worksheet it would look like this:

C1

C2

2

4

21

30

 

If you had used SET instead of the READ command like this:

MTB>SET INTO C1

DATA>2, 4

DATA> END

MTB>SET INTO C2

DATA>21 30

DATA> END

Your worksheet would look like this:

C1

C2

2

21

4

30

 

MINITAB is used primarily to manipulate numbers; however, it is possible to utilize character data as well. Each character data item (row of a specific column) may be up to 80 characters. Any numeral that appear in a defined character column will be treated as alpha characters and cannot be used for computations. To enter alphabetic data:

Prompt

Command

Results

MTB>

READ C1 C2;

This command tells MINITAB you want to enter data but you must have a subcommand because of the semi-colon.

SUBC>

FORMat (a8,a5).

This subcommand tells MINITAB the length of the alpha data you will be entering in each column.

DATA>

 

You may now enter character data.

 

Naming Variables

The following command is sued to named columns or variables:

Prompt

Command

Results

MTB>

NAME C1 'name1' C2'name2'

Variable names must be eight characters or less. Embedded spaces are not permitted. YOU MUST USE THE SINGLE QUOTES OR MINITAB WILL IGNORE THEM.

Once you name a column, you may use that name to refer to the column but the name must always be enclosed in single quotes, i.e. NAME C1 'age' DESC 'age'.

Correcting Data in the Worksheet

There are three commands that are useful for correcting data in a worksheet: LET, DELETE, and INSERT.

For example:

This worksheet has 2 columns C1 & C2

C1

C2

2

4

21

30

39

11

2

4

2

4

 

Mistakes:

(1) The underlined number, 39, should be 30.

(2) Case #2 was left out.

(3) Case #1 was inadvertently repeated as case #4 and case #5.

To correct mistake # 1 type:

MTB> LET C1 (3) = 30

The number in ( ) refers to the line # in column C1

To correct mistake # 2 type:

MTB> INSERT between rows 1 and 2 of C1..C2

This gives you a blank line between existing rows 1 & 2

[Note: To add rows of data to the end of the columns, use:MTB> INSERT into C1..C2]

To correct mistake # 3 type:

MTB> DELETE rows 4:5 C1..C2

Consecutive rows may be abbreviated by using a colon --4:5

 

Case Selection (Using or Omitting Rows)

To select cases that have certain values (i.e. sex) for a particular analysis, use the following the COPY command with its subcommands USE and OMIT to specify the cases you wish to utilize.

Prompt

Command

Results

MTB>

SUBC>

Copy C1-C5 to C11-14;

Use 4 8 10:15

This command instructs MINITAB to copy C1 to C5 into C12 to C14 but only to take cases in the 4th, 8th and 10th to 15th rows. The ':' designates a range of row numbers.

MTB>

SUBC>

Copy C2-C4 to C12-14;

Use C1=2:5.

This command instructs MINITAB to specify a subset of rows to use based on the values of data in a column. Here, only cases with a value between 2 and 5 in C1 would be used.

MTB>

SUBC>

Copy C1-C3 to C5-C8;

Omit 1:10

This command instructs MINITAB to omit any rows below 11.

MTB>

SUBC>

Copy C2-C4 TO C12-C14;

Omit C1 = 2:5

This command tells MINITAB not to use cases with a value between 2 and 5 in CI.

 

Recoding Variable Values

To change a values of a variable (column) to another values, use the following:

Prompt

Command

Results

MTB>

Code (50) to100 C1

This command will search for the value 50 and change it to 100 for each case in column 1.

This command may also be used to change codes that indicate missing values in data sets to '*' which is the MINITAB missing value.

 

Brief Summary of Commands

General Information:

HELP

(explains MINITAB commands)

INFO

(gives the status of the worksheet)

STOP

(end the current session)

Input & Output:

END

(end input entered with READ, SET)

NAME

(for C is 'name' -- names columns)

NEWPage

(starts next output on a fresh page)

OUTFILE

('filename' put all output into a file)

OH

(= K output height of file)

OW

(= K output width of file)

JOURnal

(records your session in a file called MINITAB.MTJ)

PRINt

(C…C to view data in C…C on the screen)

READ

(C…C enter row data from terminal or data file)

RETRieve

('filename' retreive a copy of the saved worksheet)

SAVE

(in 'filename' a copy of the worksheet)

SET

(C..C enter column data from terminal or data file)

WRITe

(to 'filename' the data in C…C)

Manipulating Data:

ALPHa

(convert alpha data from Release 5 worksheets)

CODE

(change existing values to new values)

CONCatenate

(combine alpha columns)

CONVert

(convert numeric data to alpha data)

COPY

(copy entire or partial columns)

DELEte

(delete rows K…K from columns C…C)

INSErt

(insert rows also append to columns of worksheet)

LET

(C(K) = K # changes the contents of row K of column C)

STACk

(stack columns and constants)

UNSTack

(unstack columns)

One-Number Stats for Columns and Rows:

N

C[put into K]

RN

C,…C, pt in Cn

NMISS

C[put into K]

RNMISS

C,…C, pt in Cn

MEAN

C[put into K]

RMEAN

C,…C, pt in Cn

MEDIAN

C[put into K]

RMEDIAN

C,…C, pt in Cn

STDEV

C[put into K]

RSTDEV

C,…C, pt in Cn

MAX

C[put into K]

RMAX

C,…C, pt in Cn

MIN

C[put into K]

RMIN

C,…C, pt in Cn

SUM

C[put into K]

RSUM

C,…C, pt in Cn

SSQ

C[put into K]

RSSQ

C,…C, pt in Cn

COUNT

C[put into K]

RCOUNT

C,…C, pt in Cn

 

Use MINTAB and enjoy!