








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Calculating derived variables
Calculating new variables using
syntax When you clicked on PASTE the following commands should have appeared on the syntax window
COMPUTE diff = income - expend. Execute.
Notice:
Now go back to the data window and delete the new variable Return to the syntax window and run the first command
Calculating new variables using
Using IF statements from the menu
On the compute variable dialog box:
When you finish click PASTE
Using IF statements in the syntax
window The result is
IF (diff < 0 ) deficit = -.
EXECUTE.
Lets add the other conditions
IF (diff < 0 ) deficit = -.
IF (diff = 0 ) deficit = 0.
IF (diff > 0 ) deficit = 1.
EXECUTE.
For example, in the data set “ind data.sav”, children
would not be expected to have income. So most
individuals under 15 have a system missing value for
s1bq01 (Q01 Did..do any work during last month?).
Two overall types: System missing : shown as a dot on your data table User defined missing : certain values can be declared as missing values.
So let’s change the value of s1bq01 to 3 if the respondent did not do any work last month and the individual is younger than 15 years old.
if ( age < 15 and sysmis(s1bq01)) s1bq01 = 3. execute.
Using the syntax Using the variable view window
Missing value s1bq01 (3).