0% found this document useful (0 votes)
82 views13 pages

Introduction To SPSS: Exercises

Good SSP exercise

Uploaded by

Blacks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views13 pages

Introduction To SPSS: Exercises

Good SSP exercise

Uploaded by

Blacks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Technology Skills Development Team

Introduction to SPSS

Exercises

June 2013

www.intranet.birmingham.ac.uk/itskills
SPSS

Author: Linda Clark


Version: 2.1, June 2013
© The University of Birmingham, 2012.
All rights reserved; no part of this publication may be photocopied, recorded or
otherwise reproduced, stored in a retrieval system or transmitted in any form by any
electrical or mechanical means without permission of the copyright holder.

Trademarks: Microsoft Access is a registered trademark of Microsoft Corporation. All brand


names and product names used in this handbook are trademarks, registered trademarks, or
trade names of their respective holder
A Study of the Wonderful People Who Come on Research Skills Training
Courses in the West Midlands
Please complete the following questions by ticking the appropriate box(es) or writing brief information in the
space provided when requested. (You do not have to tell the truth!)

1. What is your gender?

Male Female

2. What colour are your eyes?

blue brown green grey other

3. How tall are you? 180 cm


4. Which of the following best describes where you live?

a city a town the countryside don’t know

5. How far did you travel to get here today? 9 km


6. How much do you like chocolate?

not at all a little bit quite a lot very much

7. What colour is your car?

silver black white green blue red other

8. How satisfied are you with your job?

very satisfied
fairly satisfied
no opinion
a little dissatisfied
very dissatisfied

9. If you could be any of the following, which would you choose to be?
Prime Minister Road Sweeper Teacher Call Centre Op

10. How much are you paid per annum? 26,500


11. What is the post code of your place of work? B2 5JS
12. Where did you go for your last holiday?
UK Europe Outside Europe Other
A Study of the Wonderful People Who Come on Research Skills Training
Courses in the West Midlands
Please complete the following questions by ticking the appropriate box(es) or writing brief information in the
space provided when requested. (You do not have to tell the truth!)

1. What is your gender?

Male 1 Female 2

2. What colour are your eyes?

blue 1 brown 2 green 3 grey 4 other 5

3. How tall are you? ········································································································

4. Which of the following best describes where you live?

a city 1 a town 2 the countryside 3 don’t know 4

5. How far did you travel to get here today? ··································································

6. How much do you like chocolate?

not at all 1 a little bit 2 quite a lot 3 very much 4

7. What colour is your car?

silver 1 black 2 white 3 green 4 blue 5 red 6 other 7

8. How satisfied are you with your job?

very satisfied 1

fairly satisfied 2

no opinion 3

a little dissatisfied 4
very dissatisfied 5

9. If you could be any of the following, which would you choose to be?
Prime Minister 1 Road Sweeper 2 Teacher 3 Call Centre Op 4

10. How much are you paid per annum? ··········································································


11. What is the post code of your place of work? ····························································
13. Where did you go for your last holiday?
UK 1 Europe 2 Outside Europe 3 Other 4
SPSS Exercises
Exercise 1 – Login and Copy Files

As you arrive, please logon to the machine and then copy the files you will be using during the session
from the CD which is already in the machine to your own U drive area.

1. Please logon to the machine using your usual ADF username


2. On the desktop, double click on the Computer icon in the top left corner
3. In the left column, click on DVD RW Drive (D:) Disk
4. On the right hand side, double click on the SPSS folder
5. Right click on the file called brakes and choose Copy
6. In the left column, click on your U drive – it will be something like yourusername
(\\yournetworkaddress) (U:)
7. Point to the right hand pane, right click and choose Paste
8. Repeat the above steps to copy the following files as well:
dischargedata
Employee data
sales performance
Study of Wonderful People 2011
9. When you are asked to open a file during the exercises, use this copy on your U drive.

Exercise 2 – Start SPSS


1. Go to the Start Menu
2. Click on All Programs
3. Click on ITS Applications
4. Click on IBM SPSS Statistics
5. Click on IM SPSS Statistics 21. It will take a minute or so for the software to start.
6. At the main screen, click on Type in Data

The SPSS Screen


The SPSS screen consists of rows and columns. The columns are for the variables – for us today, this will
be the questions on our questionnaire. The rows are for cases – for us today, this will be one person
replying to our questionnaire.

There are two views – Data View and Variable View. Data View is where we enter and work with the
data. However, we cannot do this until we have defined the Variables (ie our questions).

Exercise 3 – Define ID Variable

First we must define the variables. The first variable will be an ID number which will allow us to cross-
reference the paper reply with the data entered on screen.

Linda Clark 1 10 April 2014


SPSS Exercises
1. Click on Variable View button at bottom left of screen
2. Click in Name column on first row and type: ID
The name must be unique, can be up to 64 characters and must not contain spaces.
3. Click in Type column and click on blue button which appears. Note the data types available.
4. Click on Numeric if not already selected
5. Click on OK
6. Click in the Decimals column.
7. Use the small arrows to change this to 0
8. Click in the Label column. Here you can enter a description of up to 256 characters, including
spaces, for this variable.
9. Enter: Identification Number
10. Click in the Measure column
11. Set this as Scale
The Measure column has three settings. Scale is used for continuous numbers, such as height,
distance, salary. Ordinal is used where things are ranked in an order, for example 1st, 2nd, 3rd,
how satisfied are you. Nominal is used where non-numeric replies have been assigned a code,
for example Gender, Eye Colour.

Exercise 4 – Define Gender Variable

The next variable will be the first question on the questionnaire.

1. Click in the Name column on row 2


2. Set the Name as: Gender
3. Change Decimals to 0
4. Set the Label as: Male/Female
5. Click in the Values column
6. Click on the blue button which appears
7. In the Value box, type: 1
8. In the Label box, type: Male
9. Click on the Add button
10. In the Value box, type 2
11. In the Label box, type: Female
12. Click on the Add button
13. Click on OK
The Values box is where we assign numeric codes to our non-numeric questionnaire answers,
such as male/female or eye colours.
14. Click in the Missing column
15. Click on the blue button which appears
16. Click against Discrete missing values
17. Click in the first box under Discrete missing values
18. Type: 999

Linda Clark 2 10 April 2014


SPSS Exercises
19. Click on OK
The Missing column allows us to define a value which we can use if data has not been filled in.
Of course, make sure that the value you choose for Missing data is not a value which could be a
valid answer to the question! For example, don’t use the value 99 for Missing in an Age column
as someone could well be 99 years old.
20. Click in the Values column
21. Click on the blue box which appears
22. In the Value box, type: 999
23. In the Label box, type Missing
24. Click on OK
It is a good idea to add the Missing value of 999 to the Values box – you will see why this is later.
25. Set Scale to Nominal
26. Continue to add a few more of the variables from the questionnaire – you don’t need to do all of
them, four or five is enough

Exercise 5 – Enter data


1. Click on the Data View button at the bottom left of the screen
2. Click in the ID column on the first row
3. Enter: 1
(When you do this for real, write this number on the questionnaire as well)
4. Click in the Gender column.
5. Enter: 1
We set Male as 1. You may be able to remember these values, but once you have a lot of
variables, it becomes harder to remember the values and you are more likely to make mistakes.
SPSS gives us the option to enter data in Numeric View or Text View.
6. On the toolbar, click on the Value Labels button.

This button toggles between Numeric View and Text View. You are now in Text View and can
enter data by selecting from a drop down list rather than entering the values.
7. Click in the Gender column again
8. Click on the drop down arrow which appears – if it doesn’t appear, click on the Gender column a
second time
9. Select Male from the drop down list
10. Continue to enter the rest of the data for this questionnaire
11. Enter a second row of data, making up answers for yourself
12. Save the file
When you save the file (or do almost anything else!), SPSS opens up an Output Report. If this
output report gives you the results of an analysis, you may wish to save it. If it is just telling you
that you have opened a file, etc, then you can close the output report without saving it.

Linda Clark 3 10 April 2014


SPSS Exercises
13. Close the output report window
14. Click on No to say you don’t want to save it

Exercise 6 - Sort Data

Next we will look at a number of simple analyses.

Sort the data file into ascending/descending order on one or more variables.

1. Go to the File Menu


2. Click on Open and then Data
3. Navigate to the folder where you copied the files earlier
4. Open Study of Wonderful People 2011
5. Go to Data Menu, Sort Cases
6. Click on Reset button
7. Double click on Gender and Salary variables to add them to Sort by box on right
8. Click on Gender in Sort by box on right and choose Ascending
9. Click on Salary in Sort by box on right and choose Descending
10. Click OK
11. Close output report without saving it
12. Look at the order of the cases. Notice that the Male cases now show first and are listed in
descending order of salary.

Exercise 7 – Select Cases and Run Frequency Table

Find which eye colour is more common in Male respondents.

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Data Menu, Select Cases
3. Click on Reset button
4. Select If Condition Is Satisfied
5. Click on If button below it
6. In variable list, double click on Gender to send to calculation pane on right
7. Click after Gender in the calculation pane on right
8. Either type or use buttons to add =1
(This is the value for Male in the Gender variable)
9. The calculation pane should now read Gender = 1
10. Click on Continue
11. Click on OK
12. Close output report
13. Look at the case numbers on the left
14. Go to Analyse Menu, Descriptive Stats, Frequencies
15. Click on Reset

Linda Clark 4 10 April 2014


SPSS Exercises
16. From variable list, send Gender and Eye Colour to Variable box on the right
17. Click on OK
18. Look at and then close output report
19. When you switch use a Filter, it remains switched on until you manually switch it off. It is
therefore very important to remember to switch off a filter afterwards.
20. Go to Data Menu, Select Cases
21. Select All Cases
22. Click on OK

Exercise 8 – Split Data into Groups

Compare average height for Male and Female. This could be done by selecting the female cases as
above, and then the male cases, but it can also be done in one step by splitting the data into groups.

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Data Menu, Split File
3. Click on Reset button
4. On the right, click on Compare Groups
5. In variable list, double click on Gender to send to Groups based on pane on right
6. Click on OK
7. Close output report
8. Look at data in Gender field – Male are grouped together at the top
9. Go to Analyse Menu, Descriptive Stats, Descriptives
10. In variable list, double click on How tall are you to send to the Variable box on the right
11. Click on OK
12. Look at the output report: two groups are shown.
13. Close the output report
14. Remember to remove the filter afterwards – Data Menu, Split File
15. On the right, click on Analyse all cases, do not create groups
16. Click on OK

Exercise 9 – Recode Data into two variables


Find how many respondents like chocolate. First you will need to recode the How much do you like
chocolate variable into a different variable using value 1 for Dislike and value 2 for Like.

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Transform Menu, Recode into Different Variables
3. Click on Reset button
4. Double click on How much do you like chocolate on left
5. Under Output Variable on right, click in Name box and type LikeDislikeChoc Click in Label box
and type recoded Choc into 2 variables

Linda Clark 5 10 April 2014


SPSS Exercises
6. Click on Change button
7. Click on Old and New Values button
8. Under Old Value, click on Value and type 1 in the box
9. Under New Value, click in Value box and type 1
10. Click on Add button
11. Under Old Value, click on Range
12. In first box underneath type 2 and in second box type 4
13. Under New Value, click in Value box and type 2
14. Click on Add button
15. Click on Continue
16. Click on OK
17. Close output report
18. Look at new variable on the right – it shows the values 1 or 2
19. Go to Variables View
20. In LikeDislikeChoc row, click on Values column
21. Click on ellipsis button
22. Add values of 1 Dislike, 2 Like
23. Click on OK
24. Set Decimals to 0
25. Set Measure to Nominal
26. Go to Data View
27. Look again at the new variable on the right – it now shows Like or Dislike
28. Go to Analyse Menu, Descriptive Stats, Crosstabs
29. Click on Reset button
30. In the variables list on the left, click on Recoded Choc into 2 variables
31. Click on the blue arrow button next to the Rows box
32. In the variables list on the left, click on What is your gender
33. Click on the blue arrow button next to the Columns box
34. Click on OK
35. Look at and then close output report

Exercise 10 – Recode into Different Variables and run Crosstab


Find how many respondents are satisfied with their job. First you will need to recode the Job
Satisfaction variable into a different variable using value 1 for Dissatisfied and value 2 for Satisfied. Then
you will need to run a Crosstabs analysis. You should also consider what to do with people who have no
opinion – for example create a third value or leave them out?

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Transform Menu, Recode into Different Variables
3. Click on Reset button
4. Double click on JobSat on left

Linda Clark 6 10 April 2014


SPSS Exercises
5. Under Output Variable on right, click in Name box and type SatisDissatJob
6. Click in Label box and type recoded JobSat into 2 variables
7. Click on Change button
8. Click on Old and New Values button
9. Under Old Value, click on Range
10. In first box underneath type 1 and in second box type 2
11. Under New Value, click in Value box and type 1
12. Click on Add button
13. In similar way, recode the Old Value Range 4 thru 5 into a New Value of 2
14. Click on Continue
15. Click on OK
16. Close output report
17. Look at new variable on the right
18. Go to Variables View
19. In SatisDissatJob row, click on Values column
20. Click on ellipsis button
21. Add values of 1 Dissatisfied, 2 Satisfied
22. Click on OK
23. Set Decimals to 0
24. Set Measure to Nominal
25. Go to Data View
26. Look again at the new variable on the right
27. Go to Analyse Menu, Descriptive Stats, Crosstabs
28. Click on Reset button
29. Send Recoded JobSat to Rows box
30. Send Gender to Columns box
31. Click on OK
32. Look at and then close output report

Exercise 11 – Compute

From the Salary variable, compute (ie calculate) the Monthly Salary.

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Transform Menu, Compute Variable
3. Click on Reset button
4. In Target Variable field, type SalMonth
5. Click on Type and Label button
6. In Label field, type Monthly Salary
7. Click Continue
8. In Variable list, select Salary and send to Numeric Expression box
9. Click after Salary in the Numeric Expression window

Linda Clark 7 10 April 2014


SPSS Exercises
10. Either type or use the buttons to complete the numeric expression by adding /12
11. Numeric Expression box should now read Salary/12
12. Click OK
13. Close output report
14. Look at the new variable on the right

Exercise 12 - Compute

From the Monthly Salary variable, compute the Monthly Deductions – say 25% of monthly salary

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Transform Menu, Compute Variable
3. Click on Reset button
4. In Target Variable field, type DeductMonth
5. Click on Type and Label button
6. In Label field, type Monthly Deductions
7. Click Continue
8. In Variable list, select Monthly Salary and send to Numeric Expression box
9. Click after SalMonth in the Numeric Expression window
10. Either type or use the buttons to complete the numeric expression by adding *0.25
11. Numeric Expression box should now read SalMonth *0.25
12. Click OK
13. Close output report
14. Look at the new variable on the right

Exercise 13 - Compute

From the Monthly Salary and Monthly Deductions variables, compute the Net Monthly Salary

1. Open Study of Wonderful People 2011 file if it is not already open


2. Go to Transform Menu, Compute Variable
3. Click on Reset button
4. In Target Variable field, type NetMonth
5. Click on Type and Label button
6. In Label field, type Net Monthly Salary
7. Click Continue
8. In Variable list, select Monthly Salary and send to Numeric Expression box
9. Click after SalMonth in Numeric Expression box and press the spacebar
10. Either type or use the buttons to add –
11. Press the spacebar
12. In Variable list, select Monthly Deductions and send to Numeric Expression box
13. Numeric Expression box should now read SalMonth - DeductMonth

Linda Clark 8 10 April 2014


SPSS Exercises
14. Click OK
15. Close output report
16. Look at the new variable on the right

Exercise 14 – Creating Charts


The easiest way to create a chart is to use the Legacy Dialogs option.

1. Open Employee Data file if it is not already open


2. Go to Graphs menu, Legacy Dialogs, Pie
3. Click on Define button
4. Click on Reset button
5. Send Which Occupation to Define Slices by
6. Click OK
7. The chart appears in the output report.

Exercise 15 – Edit the Chart


1. Double click the chart in the output report to open it for editing
2. In the chart editor window, click on the chart to select the chart itself
3. With the chart selected, click on it a second time to select an individual slice
4. In the Properties window, click on a colour button
5. Click on Apply to change the colour of the slice
6. In Chart Editor window, click outside chart to deselect it
7. Click on chart once to select chart itself
8. In the Chart Editor window, click on Elements menu, Show Data Elements
9. In the Properties box, click on Count
10. Click on the green up arrow button
11. Click on Apply to add the count to the chart
12. In the Properties window, click on Percent
13. Click on the red cross button
14. Click on Apply to remove the percent from the chart
15. In the Chart Editor window, click on File menu, Close
16. Look at the output.
17. Leave the output report open and use the Windows taskbar to go back to Data view of the file

Linda Clark 9 10 April 2014

You might also like