Helpdesk IBM SPSS Statistics 20 METHODS | |||||||
Introduction | Sample size | Table design | Graph design | Syntax | Testing | Links | SPSS Statistics 20 |
The syntax This page is based on the online SPSS helpWe have used several webpages from the SPSS help to
summarize what the SPSS syntax is about and how you can
create it.
Working with Command SyntaxThe command language allows you to save and
automate many common tasks. It also provides some
functionality not found in the menus and dialog boxes. Pasting Syntax from Dialog BoxesThe easiest way to build a command syntax file is to make
selections in dialog boxes and paste the syntax for the
selections into a syntax window. By pasting the syntax at
each step of a lengthy analysis, you can build a job file
that allows you to repeat the analysis at a later date or
run an automated job with the Production Facility. The following example comes from the independent samples t-test output we performed elsewhere on this site. We fill in the dialog box and next click on the Paste-button:
A separate syntax window now opens. It contains the SPSS command lines to execute the t-test we defined in the dialog box above.
In the syntax window you can run the pasted syntax, edit it, and save it in a syntax file. Copying Syntax from the Output LogYou can build a syntax file by copying command syntax
from the log that appears in the Viewer. The following example comes from the independent samples t-test output we performed elsewhere on this site. If you remember that we performed a t-test for differences in average age between females and males, then this piece of syntax will be clear to you.
Below you see a syntax window with the t-test command created by both methods described here. As you can see they are identical.
Using the Syntax EditorThe Syntax Editor provides an environment specifically designed for creating, editing, and running command syntax. The Syntax Editor features:
An example to experiment with syntaxThe example below shows you a piece of syntax that is
created through the editor. In the first picture you see how we are
building an Explore command where we want percentiles to be
calculated. But of course, if you are no expert, you will most likely trust on the default settings that were picked by the SPSS development team. See also our page on the Explore command in the analysis section of this site.
And now the result of five versions of the percentiles subcommand:
If you are curious what it does, first open the data file
percentile_experiment.sav and next this syntax
five times explore percentile.sps. If you are really curious about the differences between
these five percentile algorithms, experiment with other data
for the variable V1. |
Last modified
30-10-2012
© Jos Seegers, 2009; English version by Gé Groenewegen. |