PRACTICAL SOCIAL INVESTIGATION

USING SYNTAX WINDOWS WITHIN SPSS FOR WINDOWS (Versions 8 and 10)

This page describes syntax windows and lists the files that can be downloaded from these web pages (and read into a syntax window) to allow the example statistical analyses in Chapter 9 of the book to be replicated and also to allow some additional examples of multivariate analyses to be carried out.

 

THE SYNTAX WINDOW

A bit of history: once upon a time, before the era of Windows, SPSS users had to instruct the software to perform tasks by typing commands or writing ‘programs’ in SPSS’s own command ‘language’. A useful echo of this era lives on in the form of the syntax window. A syntax window allows one to keep a record of the things that one has asked SPSS to do, and moreover allows one to do them again if necessary! This can be extremely useful if, for example, one decides to recode a variable in a slightly different way and wishes to repeat a string of analyses using the new version of the variable instead of the old one.

If one uses Statistics, Summarize, Crosstabs... (or Analyze, Descriptive Statistics, Crosstabs... if using Version 10 of SPSS) to request a cross-tabulation, but clicks on Paste rather than OK, then the relevant command language appears in a syntax window (though you may need to click on Window to move to the syntax window/editor). The request for the cross-tabulation is then submitted to SPSS by using the mouse to highlight (in black!) at least some part of each of the lines corresponding to the command, and then clicking on the small black triangle pointing to the right within the graphical menu bar (tool bar) towards the top of the main window (or by clicking on Run above this and then on Selection). To use the mouse to highlight text, click its ear down with the pointer on the first line of text required, and drag the pointer down until all the required lines are (partially) highlighted.

A whole series of commands can be pasted into and run from the syntax window, or even typed into the syntax window directly. (You need to remember that one can move between data, output and syntax windows by clicking on Window, and then on the name of the required window!) The syntax window can be saved by (while looking at the syntax window) clicking on File, then on Save As..., then typing the filename into the File Name: box, and then clicking on OK. (The file will be saved with the standard suffix .sps). Existing syntax window files can be loaded by clicking on File and then on Open… (or Open followed by Syntax..., if using Version 10 of SPSS), then selecting the pertinent drive (e.g a: for the floppy disk drive), entering the file name in the File Name: box, and clicking on Open.

 

FILES OF COMMANDS WHICH CAN BE READ INTO A SYNTAX WINDOW

These three files (pages) ending in .SPS contained annotated SPSS commands. These can be read into a syntax window within SPSS for Windows and can be used in combination with the two SPSS system files (*.SAV files) to reproduce the example data analyses described in Chapter 9 of the book and to carry out some further analyses. The SPSS commands in each of the three files can be executed by highlighting them and clicking on the appropriate symbol (or Run); the commentaries in INTEX.SPS and MVAEX.SPS also describe how the commands can be executed using the SPSS for Windows menus. (A description of how the analyses corresponding to the commands in CATEX.SPS can be carried out via SPSS menus is given on the following pages: crosanal.html , mwayanal.html).