Creating a Syntax File by Selecting Options From Windows

"The Click Method"

The SPSS package has many options and, consequently, there is more than one way to perform an analysis. In fact, there are so many options that it can be confusing. Two different methods of creating a Syntax File (Job Stream) and running the analysis are presented. The commands that make up the Syntax File can be typed into the file using a text editor or the commands can be created by clicking the mouse on various window selections and the results can be saved to a Syntax File. The example presented above uses the method of typing in the commands.
In the next example, the analysis will be performed by clicking on various commands. Further, the commands will be saved in a SPSS Syntax file like the one above. The analysis can be run without saving the syntax to a file. For the purposes of this course, you should always save the commands to a Job Stream (Syntax File). There are at least two good reasons for saving the commands: (1) you have a record of what you did, and (2) when you need to re-run the analysis (or when you need it a year later) it can be rerun with the click of the mouse.

NOTE: If there is currently a Syntax window open it should be closed. It is closed in the following manner:

Click on box in the upper left hand corner of the Syntax window (as indicated by the arrow) and when the next window appears click on "Close."

This procedure assumes that SPSS is open and that there is a data file open within SPSS

How to Open SPSS click here.

How to Open a Data File Click here

In this example a t-test will be computed between "Human and Animal" cartoon characters from the

Fake Data Sample.

In that sample data set there are some cartoon characters that are animal (i.e., Mickey Mouse and the Road Runner) and some cartoon characters that are human (i.e., the Mad Hatter and Cinderella).  In this example a t-test will be computed comparing "animals" to "humans" on the item of whether in they felt like they had "spent worthwhile days."

Click here to see questionnaire.

Click Analyze.

When you click "Analyze" in the above Window and the pull down menu below appears. Move the cursor over Compare Means and a second pull down menu appears.

Click on Independent-Sample T-Test and the following window appears.

Select the group variable and Click on the Right Delta for Grouping Variable and group(? ?) is entered into the Grouping Variable window as follows:

Click on Define Groups and the following window appears.

Enter a 1 for Group 1 and a 2 for Group 2 and press Continue.

Select Worth and Click the delta button to the left of Test Variable(s): window and the following window appears:

Click Paste and the Syntax window appears along with the syntax for running the T-Test.

One more step to go.   Add the data file name.

Enter file name--including drive and subdirectory.

The "get file==e:/dape/pasdata1.sav" is not created by the computer and must be entered by typing it into the file.

For purposes of this course, the Syntax File needs to be saved. Before it is saved it needs to be modified so that it will call the data and, at the same, time document the data file needed for this analysis. The command "GET FILE='e:/dape/pasdata1.sav.'" (with your file name) needs to be added to the "Job Stream." This is accomplished by simply typing the command into the "Syntax Window" so that it looks like this:

This file can now be saved in the same manner as before when saving a data The steps are as follows:
1. Click on the Syntax window to select it (if it is not already selected)
2. Click on "File"
Click on "Save SPSS Syntax"
Enter the desired name of the Syntax file (in this case "e:/dape/padtt1.sps"--yours should be different) in the "File Name" box.
5. Press

For a detailed description of saving a syntax file click here.

To run the program (Execute the Program or Submit the Program for Analysis).
Click on Run
Click on All

For detailed description of submitting a program and other methods of submitting a program click here.


Copyright Information