SHAZAM Program

SHAZAM Program


A SHAZAM program contains a list of commands that give instructions for processing by the SHAZAM system. A SHAZAM program is prepared in a command file. A text editor can be used to create and modify the command file.

The SHAZAM command file should be assigned some appropriate filename. It may be useful to use the extension .SHA for SHAZAM command files. Then a file with a name like WORK.SHA is immediately recognizable as a SHAZAM command file.

An example of a SHAZAM command file for obtaining summary statistics for the Theil textile data set is below.

SAMPLE 1 17
READ (THEIL.txt) YEAR CONSUME INCOME PRICE
* Summary statistics for the textile data
STAT CONSUME INCOME PRICE
STOP

The first command is a SAMPLE command, and the second command is a READ command to load the data and assign variable names. The final command is the STOP command. This is typical of most SHAZAM programs. The STOP command tells SHAZAM that the work is finished. Any lines that are typed after the STOP command are ignored by SHAZAM.

The next SHAZAM program extends the analysis to consider working with log-transformed data. Note the use of comment statements. Also, near the end of the program, note the use of the SAMPLE command to specify a different sample period for the commands that follow.

SAMPLE 1 17
READ (THEIL.txt) YEAR CONSUME INCOME PRICE
* Summary statistics for the textile data
STAT CONSUME INCOME PRICE
* Now get logarithms of the data
GENR LCONS=LOG(CONSUME)
GENR LINC=LOG(INCOME)
GENR LPRICE=LOG(PRICE)
* List the data
PRINT LCONS LINC LPRICE
* Summary statistics for the log-transformed data set
STAT LCONS LINC LPRICE / PCOV PCOR
* Write the new data to the file TLOG.txt
WRITE (TLOG.txt) YEAR LCONS LINC LPRICE
*
* Repeat the analysis on a sub-set of the data
SAMPLE 3 17
STAT LCONS LINC LPRICE / PCOV PCOR
STOP


Home [SHAZAM Guide home]