Processing/Syntax

What is data processing?

When we “process” data we make changes to a dataset that enable us to run the analyses we want to run. So we might recode some variables, or define some values as missing, or drop out some incomplete cases. We do all this getting-ready work before we run any actual analyses. While it is conceivable that you might download a perfect dataset and not need to do any processing, it is highly unlikely. And it is definitely not the case with this dataset.

What is syntax?

Think of syntax as the instructions (“commands” or “code”) we give to the computer. Other people who are trying to reproduce our work will use our syntax to replicate the steps we took to go from our original data to our analysis data. Many people write their own syntax. I admire those people but am not generally one of them. You do not have to write syntax to do this exercise. You are going to get the syntax in two different ways. First, you can copy a lot of the syntax out of SPSS. Where is it? Any time you use a menu to execute a command, SPSS provides the syntax for the command in the output window. Alternately, you can push the button that says “paste” when you ask SPSS to run commands (it’s at the bottom of the dialog box) and the syntax will automatically appear in a syntax window. Second, I will provide some of the syntax for you. You can just copy my syntax and paste it directly into the syntax file.

When you look at syntax, you will see that some lines have a * in front them. This means that the line is a comment. Comments are me (as the researcher) talking to you so that you can understand my code. All good coders include comments (this is obviously to help other people read the code but it is also for the coders themselves so they don’t forget what they did). It is okay to leave the comments in when you run the code in SPSS, the program ignores them because of the asterisk at the beginning and the period at the end of the line.

What is a syntax file?

The syntax file is a special kind of SPSS file where we save our syntax.  We also run the syntax from the syntax file.  You have to ask SPSS to open a syntax file, it’s under “File” then “New” and finally “Syntax” in the menus.   SPSS syntax files have the postscript .sps.