SHAZAM on the internet

How to run SHAZAM over the internet


Simple SHAZAM programs can be run over the internet from the link on the SHAZAM homepage. Data files on the SHAZAM server can be accessed. Data files cannot be loaded and read from the user's computer.

You can follow the exercise below to learn the basics of using SHAZAM.

A data set with annual inflation rates for the 21 year period 1960 to 1980 for 5 countries (USA, UK, Japan, Germany and France) has been prepared in a data file.

Step 1: Prepare a SHAZAM command file

A SHAZAM command file contains a set of commands that are instructions for SHAZAM. The command file can be prepared with a text editor such as Notepad. This editor is available with Microsoft Windows. It may be useful to place the editor icon on the desktop.

SHAZAM commands for calculating summary statistics, including the mean and median, for the inflation rate data are:

SAMPLE 1 21
READ (intro/IRATE.txt) YEAR USA UK JAPAN GERMANY FRANCE 
* Calculate the mean and the median
STAT USA UK JAPAN GERMANY FRANCE / PMEDIAN
STOP

  • The first command is a SAMPLE command that specifies the first and last observation numbers in the sample.
  • The second command is a READ command. This command loads the data set and assigns variable names. The filename of the data file is specified in brackets. The filename given in this example is available when running SHAZAM over the internet. In this example, upper case and lower case are not interchangeable for filenames.
  • Lines beginning with * are comment statements. These are ignored by SHAZAM. Comment statements are very useful for describing the work that you are trying to do.
  • The STAT command requests the calculation of summary statistics on the data. SHAZAM commands can have "options" that are specified after the / character. For the STAT command the PMEDIAN option is used to compute the median.
  • The final command is a STOP command. This command tells SHAZAM that the work is finished.

  Save your SHAZAM command file

On your computer create a SHAZAM folder for your work and save the SHAZAM command file to this folder.

Step 2: Run SHAZAM

You can run SHAZAM over the internet from the link on the SHAZAM homepage as follows.

  • SHAZAM commands are entered in the box in the upper frame.
  • Click on the button to submit the commands to SHAZAM for processing.
  • The SHAZAM output is displayed in the lower frame. The output file contains all the results of the data analysis.

  Save your SHAZAM output file

The SHAZAM output should be carefully reviewed. If error messages appear then the command file must be corrected and re-submitted to SHAZAM.

You can save the output file to your SHAZAM folder.

Step 3: Get More Practice with SHAZAM

More discussion on the analysis of the inflation rate data set with SHAZAM is available.

The exercise below gives practice with two useful SHAZAM commands. The GENR command is used for creating new variables. The PRINT command is used to list the variables on the SHAZAM output.

With the inflation rate data set consider calculating an annual "world inflation rate" for the period 1960 to 1980. A way of doing this is to compute an average inflation rate for each year. The SHAZAM commands below show how the GENR command can be used to construct a world inflation rate. Summary statistics are calculated with the STAT command.

SAMPLE 1 21
READ (intro/IRATE.txt) YEAR USA UK JAPAN GERMANY FRANCE 
* Calculate a world inflation rate
GENR WORLD=(USA+UK+JAPAN+GERMANY+FRANCE)/5
PRINT YEAR WORLD
STAT WORLD / PMEDIAN
STOP

Try running this example. Get the SHAZAM output and then answer the following questions. For the world inflation rate, which year has the highest inflation rate and which year has the lowest inflation rate ? How do you explain the differences in the mean and the median ?

  The GENR command

For the GENR command the arithmetic expression that is given after the equal sign (=) is evaluated (any variable that is given in this expression must already exist). The result is saved in the variable that appears before the equal sign. If the result variable does not exist then SHAZAM will create it. If the result variable is already created then SHAZAM will replace the old variable with the new results.

Arithmetic expressions are evaluated from left to right. However, some operators take priority. The rules are given in the GENR command documentation. Expressions in parentheses are always evaluated first. Therefore, to avoid confusion use as many levels of parentheses as desired.


Home [SHAZAM Guide home]