








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Instructions on how to calculate new variables using the menu system and syntax in spss, as well as using if statements to apply different formulas based on variable values. Topics covered include creating a new variable, using the if command, and labeling variables and values.
Typology: Slides
1 / 14
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).