clods’ guide 2 pre-course questionnaire exercises on full cumulative data 1
TRANSCRIPT
1
Clods’ Guide 2
Pre-course questionnaire
Exercises on full cumulative data
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
8
New Data Editor in
. . but we also need to open a new Syntax Editor
9
10
New SPSS Syntax Editor
11
2: Read in your data
12
data list file 'e:\myclass.txt' records 1 /1 serial 1-2
v4 to v8 4-8 v10 to v12 10-12 v14 14 v16 to v20 16 - 20 sex 22 v24 24 age 26-27 metres 29-32 (2) feet 34 inches 36-37.
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!
13
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
14
Data List will read 1 records from e:\myclass.txt
variable Rec Start End Formatserial 1 1 2 F2.0v4 1 4 4 F1.0v5 1 5 5 F1.0v6 1 6 6 F1.0v7 1 7 7 F1.0v8 1 8 8 F1.0v10 1 10 10 F1.0v11 1 11 11 F1.0v12 1 12 12 F1.0v14 1 14 14 F1.0v16 1 16 16 F1.0v17 1 17 17 F1.0v18 1 18 18 F1.0v19 1 19 19 F1.0v20 1 20 20 F1.0sex 1 22 22 F1.0v24 1 24 24 F1.0age 1 26 27 F2.0metres 1 29 32 F4.2feet 1 34 34 F1.0inches 1 36 37 F2.0
15
*Untitled in
[NB: In the Measure column, all levels are Unknown
16
*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
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
18
*Untitled has filled up
19
*Untitled in
. . and the levels have changed in the Measure column
20
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).
21
SAvE YOUR WORK
!
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<increment>.<type>
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
23
To save a file with the same name use
To save a file with a different name use
24
It doesn’t matter whether you are in
25
. . or
26
Navigate to
Change Untitled to myclass1
. . and click on
[NB: Window displays only files with *.sav extension: other files are not displayed]
27
File has been saved as myclass1.sav in folder myclass
28
File name has been changed to
29
Now save your syntax file
30
31
Navigate to folder myclass
Change Syntax* to myclass1
. . and click on
[NB: Window displays only files with *.sps extension: other files are not displayed]
32
File myclass1.sps has been saved in folder myclass
33
The file name has changed to
34
4: Label your variables
35
Go back to myclass1.sav
36
37
SPSS opens new Syntax Editor
38
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.
39
Click on the green triangle in the tool bar
40
Your variable labels are now displayed in the Label column.
Data Editor in
41
Save your work again!
42
Do not use It will over-write the file
43
Navigate to folder myclass
44
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
45
File myclass2.sav has been saved in folder myclass
46
File name changes to myclass2.sav
47
Now save your syntax file
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
54
4: Specify value labels
55
56
value labelsv10 to v12
1 'very likely'2 'Quite likely'3 'Not very likely'4 'Not likely'
/v14 1 'very satisfied.'2 'Quite satisfied.'3 'Neither'4 'Quite dissatisfied'5 'very dissatisfied'
/v16 1 'Typing'2 'Word- process'3 'Social statistics'4 'Survey analysis'5 'Other'
/sex 1 'Male'2 'Female'
/v24 1 '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!
57Click 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
70
Save the file with a different (incremental) name
Change syntax* to myclass3
Navigate to
Click on
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!