Clods’ Guide 2 Pre-course questionnaire Exercises on full cumulative data 1
2 La mise en place (3 – 10) Read in your data (11 – 20) Save your work! (21 – 31) Label your variables (33 – 53) Label the values of your variables (54 - (except Scale) Slide guide
3 1: La mise en place
4 Is SPSS still open? If so, is your file myclass0.sav still open?
5 If not, open folder myclass.. and double-click on
6 SPSS data file myclass0.sav
7 Open a new Data Editor
New Data Editor in 8.. but we also need to open a new Syntax Editor
9
New SPSS Syntax Editor 10
11 2: Read in your data
data list file 'e:\myclass.txt' records 1 /1 serial 1-2 v4 to v8 4-8 v10 to v v14 14 v16 to v sex 22 v24 24 age metres (2) feet 34 inches Type or copy/paste the following into the Syntax Editor The data list command must start in the first column. All subsequent lines should be inset by at least one space. Don’t forget the full stop at the end! 12
If data list is blue, the command is complete: if it’s red, you probably forgot the forward slash / or the full stop. ! Click on the green triangle in the tool bar 13
Data List will read 1 records from e:\myclass.txt variable Rec Start End Format serial F2.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 v F1.0 sex F1.0 v F1.0 age F2.0 metres F4.2 feet F1.0 inches F2.0 14
*Untitled in [NB: In the Measure column, all levels are Unknown 15
*Untitled in Data cells are empty because SPSS has not yet made a pass through the data, but your variable names appear in the column headers 16
Go back to the Syntax Editor and add the command: execute. If execute is blue, the command is correct: Click on the green triangle in the tool bar 17
*Untitled has filled up 18
*Untitled in.. and the levels have changed in the Measure column 19
Level (of measurement) is assigned automatically by SPSS (via a “heuristic” algorithm) and is dependent on the range of values encountered in the data pass. variables metres and inches have been assigned to Scale because they have many values, but so has serial (which is technically Nominal). Some of the variables should be Ordinal, but these need to be specified by you, either directly in the Data Editor (which leaves no audit trail) or by using syntax (which does). 20
SAvE YOUR WORK ! 21
22 File names Within the same project it’s good practice to use file names with a root indicating the topic, an incremental number to indicate the version and an extension for the type of file. For this project we are using the root myclass. myclass0.txt myclass0.sps myclass0.sav We are working in a folder called myclass and files will be called myclass. During file building, SPSS *Untitled and *Syntax files can be be saved with Once finalised they should be saved as myclass1.sav, myclass1.sav; myclass2.sav myclass2.sav using
To save a file with the same name use To save a file with a different name use 23
24 It doesn’t matter whether you are in
25.. or
Navigate to Change Untitled tomyclass1.. and click on 26 [NB: Window displays only files with *.sav extension: other files are not displayed]
File has been saved as myclass1.sav in folder myclass 27
28 File name has been changed to
Now save your syntax file 29
30
Navigate to folder myclass Change Syntax*tomyclass1.. and click on 31 [NB: Window displays only files with *.sps extension: other files are not displayed]
File myclass1.sps has been saved in folder myclass 32
33 The file name has changed to
4: Label your variables 34
35 Go back to myclass1.sav
36
37 SPSS opens new Syntax Editor
variable labels serial 'Serial number of questionnaire' /v4 'Q1 rank: Welfare State' /v5 'Q1 rank: Countryside' /v6 'Q1 rank: Defence and Nuclear Issues' /v7 'Q1 rank: Politics' /v8 'Q1 rank: Industry & Employment' /v10 'Q2a: Serious nuclear accident' /v11 'Q2b: Impossible for police to protect' /v12 'Q2c: Nuclear bomb dropped' /v14 'Q3: Satisfaction with running of NHS' /v16 'Q4: Typing' /v17 'Q4: Word-processing' /v18 'Q4: Social statistics' /v19 'Q4: Survey analysis etc' /v20 'Q4: Other computing' /sex 'Q5: Sex of respondent' /v24 'Q6: Main transport mode' /age 'Q8: Age last birthday' /metres 'Q7: Height in metres only' /feet 'Q7: Feet part of height' /inches 'Q7: Inches part of height'. Type (or copy/paste) this text into the Syntax Editor. variable labels may be in blue, but if you spell variable names wrong you’ll get an error message. SPSS can detect syntax errors, but not spelling mistakes in your labels. Make sure your labels are enclosed in primes. Don’t forget the full stop! Earlier versions of SPSS need variables to be separated by a forward slash / SPSS 22 works without them, but lack of the above is a common cause of errors. 38
Click on the green triangle in the tool bar 39
Your variable labels are now displayed in the Label column. Data Editor in 40
Save your work again! 41
Do not useIt will over-write the file 42
Navigate to folder myclass 43
Save the file with a different name (Good practice to use same root for *sps and *.sav and to add a number to indicate an increment for each version) Change myclass1 to myclass2 Click on 44
File myclass2.sav has been saved in folder myclass 45
File name changes to myclass2.sav 46
Now save your syntax file 47
48
49
50 Save the file with a different (incremental) name Change syntax* to myclass2
51 Syntax file has been saved as myclass2.sps in folder myclass
52 File name has changed to
53
4: Specify value labels 54
55
56 value labels v10 to v12 1 'very likely' 2 'Quite likely' 3 'Not very likely' 4 'Not likely' /v141 'very satisfied.' 2 'Quite satisfied.' 3 'Neither' 4 'Quite dissatisfied' 5 'very dissatisfied' /v161 'Typing' 2 'Word- process' 3 'Social statistics' 4 'Survey analysis' 5 'Other' /sex1 'Male' 2 'Female' /v241 'Public transport' 2 'Car' 3 'Motor cycle or cycle' 4 'Walk'. Type (or copy/paste) this text into the Syntax Editor. value labels may be in blue, but if you spell variable names wrong you’ll get an error message. SPSS can detect syntax errors, but not spelling mistakes in your labels. variables need to be separated by a forward slash / Make sure your labels are enclosed in primes. Don’t forget the full stop!
57 Click on the green triangle in the tool bar
58 Your labels are displayed in the values column
59 Widen the Label and values columns
60 Only the label for the lowest value is displayed
61 If you want to see all the value labels for a variable, click on a cell, You can use this box to write or edit value labels, but it takes forever. Syntax is easier and much quicker then on the blue box
62 Save your work again!
63
64 Navigate to myclass
65 Save the file with a different (incremental) name Change myclass2 to myclass3 Click on
66 File is saved as myclass3.sav in folder myclass
67 File name changes to myclass3.sav
68 Now save your syntax file
69
Save the file with a different (incremental) name Change syntax* to myclass3 Navigate to Click on 70
71 As you type, SPSS displays a list of other files in the same folder have the same root:
72 File has been saved as in folder myclass
73
74 Job done!