Data Analysis with IBM SPSS Statistics
上QQ阅读APP看书,第一时间看更新

Demo - defining variable properties

You have seen that you can Define Variable Properties either in the Variable View or via syntax. Yet another way is to use Define Variable Properties found in the Data menu. An advantage of using Define Variable Properties is that you fill in a dialog box but can use the Paste command to obtain the constructed syntax.

Here, let's consider defining variable properties for MARITAL.

To use Define Variable Properties from the menus, navigate to Data | Define Variable Properties.

This opens the Define Variable Properties dialog box. Move MARITAL to the right-hand side:

Here is a portion of the Define Variable Properties box after you press Continue:

This dialog box is an all-in-one view that shows both the variable properties and the actual data summarized. You can type in this dialog box to add Variable properties for MARITAL.

Here is the dialog box with the fields filled in:

Here is the constructed syntax when you paste:

* Define Variable Properties.
*MARITAL.
VARIABLE LABELS MARITAL 'Marital Status'.
MISSING VALUES MARITAL(9).
VALUE LABELS MARITAL
1 'Married'
2 'Widowed'
3 'Divorced'
4 'Separated'
5 'Never Married'
9 'No Answer'.
EXECUTE.
In addition to running the constructed syntax, you can archive the constructed syntax for future use on a variable with the same or very similar values. You can save the syntax by making the syntax the active window and then specifying FILE | SAVE. SPSS Statistics uses the SPS extension for SPSS syntax files.