Successfully reported this slideshow.
Upcoming SlideShare
×

# Basics of SPSS, Part 1

4,084 views

Published on

Getting started with SPSS, defining variables, entering data and importing data from Excel

• Full Name
Comment goes here.

Are you sure you want to Yes No
• SPSS slides are very useful for students. Bhatti.

Are you sure you want to  Yes  No
• These Slides are very use full for students. Bhatti

Are you sure you want to  Yes  No

### Basics of SPSS, Part 1

1. 1. Part 1: Getting started entering data and defining variables Dr.ChristinePereira 1
2. 2. Dr.ChristinePereira » Purpose and use of SPSS » Open SPSS » What is a Variable? » Defining variables in SPSS » Entering Data » Open and save data files » Import data from Excel » Handling missing data ASK at Brunel (2014) 2
3. 3. Dr.ChristinePereira » SPSS is a Statistical Software Package » SPSS is a tool It only does what it’s ‘told’ to do. It does not think for you It is not a black box » You need to know the correct statistics for your research BEFORE using SPSS. » If you understand the statistics, then you are ready to do analysis in SPSS. ASK at Brunel (2014) 3
4. 4. Click on the Windows Start Icon Type SPSS 20 into the search box Select SPSS 20 from the list 1 2 3 Dr.ChristinePereira ASK at Brunel (2014) 4
5. 5. Open NEW data file Dr.ChristinePereira ASK at Brunel (2014) 5
6. 6. Dr.ChristinePereira ASK at Brunel (2014) 6 Enter variable names in the first column of Variable View.
7. 7. Dr.ChristinePereira ASK at Brunel (2014) 7 Enter the data for each variable. Each variable name will appear as a column heading replacing var.
8. 8. What is a variable? How do we define variables in SPSS? Dr.ChristinePereira ASK at Brunel (2014) 10
9. 9. Dr.ChristinePereira » A measurement: A characteristic + E.g., Gender, Age, Height, Weight… Time points + E.g., pre-test, post-test, T0, T1, T2… Experimental Condition + E.g., Condition, Experimental group… Opinion/belief + E.g., A survey question which asks for a respondent’s level of agreement with a statement Etc… ASK at Brunel (2014) 11
10. 10. Dr.ChristinePereira ASK at Brunel (2014) 12 What is your gender? Male or Female
11. 11. Dr.ChristinePereira ASK at Brunel (2014) 13 How long does it take, on average, to commute into Uni?
12. 12. Dr.ChristinePereira ASK at Brunel (2014) 14 What is your main mode of transport to Uni?
13. 13. Dr.ChristinePereira ASK at Brunel (2014) 15 Indicate your level of agreement with this statement: “Most days, my commute causes me to feel stressed when I arrive at university”.
14. 14. Dr.ChristinePereira » Random sample of 200 residents of Uxbridge. » Asked respondents’ their view on stem cell research using a 3 pt. Likert Scale (Disagree, No Opinion, Agree). » Asked respondents’ if they believed global warming was an important issue using a 5 pt. Likert Scale (Strongly Disagree to Strongly Agree). ASK at Brunel (2014) 16 Questionnaire Responses
15. 15. Dr.ChristinePereira » Random sample of 200 residents of Uxbridge. » Asked respondents’ their view on stem cell research using a 3 pt. Likert Scale (Disagree, No Opinion, Agree). » Asked respondents’ if they believed global warming was an important issue using a 5 pt. Likert Scale (Strongly Disagree to Strongly Agree). ASK at Brunel (2014) 17 Questionnaire Responses
16. 16. Dr.ChristinePereira ASK at Brunel (2014) 18 Resident StemCell GlobalWarming 1 Agree Strongly Agree 2 Undecided Agree 3 Undecided Strongly Disagree 4 Disagree Undecided … … … Questionnaire Responses
17. 17. Dr.ChristinePereira ASK at Brunel (2014) 19 Experimental Condition Cond 1 and 2 are independent, NOT repeated measures.
18. 18. Dr.ChristinePereira ASK at Brunel (2014) 20 Score on a test
19. 19. Dr.ChristinePereira » 30 participants were used to investigate the effect of caffeine on their ability to sleep. » The 30 participants were randomly assigned to one of 2 conditions: No caffeine (control) or one dose of caffeine every 3 hours from 9am-6pm. » The study measured participants ability to sleep by taking the average number of hours slept per night over a 2 week period. ASK at Brunel (2014) 21 Caffeine and Sleep
20. 20. Dr.ChristinePereira » 30 participants were used to investigate the effect of caffeine on their ability to sleep. » The 30 participants were randomly assigned to one of 2 conditions: No caffeine (control) or one dose of caffeine every 3 hours from 9am-6pm. » The study measured participants ability to sleep by taking the average number of hours slept per night over a 2 week period. ASK at Brunel (2014) 22 Caffeine and Sleep
21. 21. Dr.ChristinePereira ASK at Brunel (2014) 23 Participant Condition AvgHoursSlept 1 Control 7.2 2 Caffeine 6.7 3 Caffeine 6.3 4 Control 6.9 … … … Caffeine and Sleep
22. 22. Dr.ChristinePereira ASK at Brunel (2014) 24 Status when admitted to care facility
23. 23. Dr.ChristinePereira ASK at Brunel (2014) 25 Anxiety level measured at 3 time points for each participant
24. 24. Dr.ChristinePereira ASK at Brunel (2014) 26 Why not enter TIME as 1 variable like we did for STATUS?
25. 25. Dr.ChristinePereira » 50 participants of varying fitness levels were used to investigate whether personal trainers make a significant difference in ones fitness. » Participants were randomly assigned to one of two training groups: self training or professional trainer. » Each participants 1 mile time (in mins) was recorded 2 days prior to the start of the study. » Each group then followed a specific training regime for 30 days and their 1 mile time (in mins) recorded again. ASK at Brunel (2014) 27 Fitness Regime
26. 26. » 50 participants of varying fitness levels were used to investigate whether personal trainers make a significant difference in ones fitness. » Participants were randomly assigned to one of two training groups: self training or professional trainer. » Each participants 1 mile time (in mins) was recorded 2 days prior to the start of the study. » Each group then followed a specific training regime for 30 days and their 1 mile time (in mins) recorded again. Dr.ChristinePereira ASK at Brunel (2014) 28 Fitness Regime Pre-test and Post-test
27. 27. Dr.ChristinePereira ASK at Brunel (2014) 30 Fitness Regime Participant Training Pre_Mile Post_Mile 1 Self 15.3 14.1 2 Professional 16.1 14.9 3 Self 20.5 16.8 4 Self 16.8 16.2 … … … …
28. 28. Dr.ChristinePereira ASK at Brunel (2014) 31 Variables Categorical Qualitative Scale Quantitative Nominal (Unranked categories)  Marital Status  Political Party  Eye Color Ordinal (Ranked categories)  Satisfaction level  Level of agreement Not grouped  Height  Weight  Age  No. of cars  No. of students • In SPSS, data is either Nominal, Ordinal or Scale. • It is essential to classify data correctly. - Incorrect classification… may result in incorrect analyses.
29. 29. Code categorical variables Enter data Dr.ChristinePereira ASK at Brunel (2014) 32
30. 30. Dr.ChristinePereira ASK at Brunel (2014) 33 Level of Measurement? Categorical variables need to be coded Scale variables do not need to be coded
31. 31. Dr.ChristinePereira ASK at Brunel (2014) 34 Level of Measurement? 0 = Male 1 = Female 1 0 1 1 1 1 0 0 0 0
32. 32. Dr.ChristinePereira ASK at Brunel (2014) 35 Level of Measurement? Scale, does not need to be coded
33. 33. Dr.ChristinePereira ASK at Brunel (2014) 36 1 = tfl (i.e. public transport) 2 = Car 3 = Cycle 4 = Walk 1 2 3 4 2 1 1 1 1 1 Level of Measurement?
34. 34. Dr.ChristinePereira ASK at Brunel (2014) 37 Indicate your level of agreement with the following statement: “Most days, my commute causes me to feel stressed when I arrive at university”.
35. 35. Dr.ChristinePereira ASK at Brunel (2014) 38 1 = Strongly Disagree 2 = Disagree 3 = I don’t know 4 = Agree 5 = Strongly Agree Level of Measurement?
36. 36. Dr.ChristinePereira ASK at Brunel (2014) 39 Data has been coded Now we’re ready to enter it in SPSS
37. 37. Dr.ChristinePereira ASK at Brunel (2014) 40 1. Enter & define variables from Variable View. • Variable names • Must begin with a letter • No spaces and no special characters (except _ )
38. 38. Dr.ChristinePereira ASK at Brunel (2014) 41 1. Enter & define variables from Variable View. • Type • Should (almost) always be numeric • SPSS cannot analyse non-numeric data
39. 39. Dr.ChristinePereira ASK at Brunel (2014) 42 1. Enter & define variables from Variable View. • Decimals • How many decimal places do you want to see in the Data View?
40. 40. Dr.ChristinePereira ASK at Brunel (2014) 43 1. Enter & define variables from Variable View. • Label • IMPORTANT!!! Make good labels! • Short description of the variable • This is what will be written on all graphs & tables
41. 41. Dr.ChristinePereira ASK at Brunel (2014) 44 1. Enter & define variables from Variable View. • Values (i.e., Value labels) • IMPORTANT!!! - Tell SPSS what all the codes represent! • This is what is written on all graphs & tables
42. 42. Dr.ChristinePereira ASK at Brunel (2014) 45 1. Enter & define variables from Variable View.
43. 43. Dr.ChristinePereira ASK at Brunel (2014) 46 1. Enter & define variables from Variable View. • Missing • Missing data can be coded too • Chose a number not in the data, like 99 or 999 • Replace all missing values in your data with this code first
44. 44. Dr.ChristinePereira ASK at Brunel (2014) 47 1. Enter & define variables from Variable View. • Measure • Level of Measurement (Nominal, Ordinal, Scale) • By default ALL new variables are unknown • YOU must choose the appropriate measure
45. 45. Dr.ChristinePereira ASK at Brunel (2014) 48 2. Enter data from Data View. • Variable names • Will become column headings in Data View.
46. 46. Dr.ChristinePereira ASK at Brunel (2014) 49 Now, let’s enter some data
47. 47. Saving and Opening Data or Output Files Dr.ChristinePereira ASK at Brunel (2014) 50
48. 48. Dr.ChristinePereira ASK at Brunel (2014) 51
49. 49. Dr.ChristinePereira ASK at Brunel (2014) 52 Locate a folder to save it in: On your H drive OR On your pen drive Name it appropriately Extension .sav
50. 50. Dr.ChristinePereira ASK at Brunel (2014) 53 Everything done in SPSS is shown here, in outline form.  Shows output for ALL analysis run in SPSS  Keeps a log of all activity of open data files  Saved with the extension .spv A data file was saved as SPSS Workshop Example.sav and logged in the output file.
51. 51. Dr.ChristinePereira ASK at Brunel (2014) 54 New data file New output file
52. 52. Dr.ChristinePereira ASK at Brunel (2014) 55 Existing data file Existing output file
53. 53. Dr.ChristinePereira ASK at Brunel (2014) 56 Importing data from Excel
56. 56. Dr.ChristinePereira » Log onto Blackboard » Go to the Organisation Academic Skills » In the left column, under Workshop Presentations Click on Statistics and SPSS » Find the SPSS Workshop Download the Excel File: “CommutingSurvey.xlsx” » Save this file somewhere you can find it later. » Do not open it. You cannot import the file if it’s open. ASK at Brunel (2014) 59
57. 57. Dr.ChristinePereira » Can be .xls OR .xlsx » Variable names CAN be imported too Must be in row 1 of the worksheet They will be imported to the Variable View » Data will appear in SPSS Data View ASK at Brunel (2014) 60
58. 58. Dr.ChristinePereira ASK at Brunel (2014) 61 Variable names (Row 1) Filename (.xlsx) This sheet contains the dataset
59. 59. ASK at Brunel (2014) 62 Existing data file Dr.ChristinePereira
60. 60. Dr.ChristinePereira ASK at Brunel (2014) 63 Choose Excel file type to see your .xlsx Find the folder where you saved the fileSelect the Excel file 3 1 2
61. 61. Dr.ChristinePereira ASK at Brunel (2014) 64 Choose the correct worksheet
62. 62. View all data Dr.ChristinePereira ASK at Brunel (2014) 65 Variable Names (from Row 1)
63. 63. Dr.ChristinePereira ASK at Brunel (2014) 66 This variable name from Excel could not be used. SPSS made it a label and created a new variable name
64. 64. Dr.ChristinePereira ASK at Brunel (2014) 67 How to handle missing data
65. 65. Dr.ChristinePereira » Any blank (i.e., missing) data is automatically considered missing by SPSS. It will not be included in the analysis. This means you DO NOT have to code missing data » Why code missing values if you don’t have to? Sometimes data accidently gets deleted. If missing values are coded then you know a blank space shouldn’t be there. There is more than one reason data is missing and you want to distinguish between them. + E.g., A participant chose not to answer a survey question or question was not applicable to them – you may want to record these as different kinds of missing data. ASK at Brunel (2014) 68
66. 66. Dr.ChristinePereira ASK at Brunel (2014) 69 There are 3 missing values for TravelTimemin • Replace missing values with a code • Use a code that will not occur for the variable • Let’s use -1, as negative time is not possible
67. 67. Dr.ChristinePereira ASK at Brunel (2014) 70 1
68. 68. Dr.ChristinePereira ASK at Brunel (2014) 71 3 Select the variable you want to recode Click here to recode the variable 2
69. 69. Dr.ChristinePereira ASK at Brunel (2014) 72 4 Enter the code as the new value Click Add. MISSING -> -1 will appear here 5 6 Click Continue then Click OK 7
70. 70. Dr.ChristinePereira ASK at Brunel (2014) 73 Missing values have been replaced with -1 for TravelTimemin
71. 71. Dr.ChristinePereira ASK at Brunel (2014) 74 Remember… From Variable View Define the missing values 8 • Discrete (whole numbers) • Enter missing value codes used for the variable (e.g., -1) • Click OK
72. 72. Dr.ChristinePereira ASK at Brunel (2014) 75 This is only a code – it tells SPSS what value(s) represent missing values. It does not replace missing values with the code for you!
73. 73. Dr.ChristinePereira » Variables go in columns » Categorical data should be coded first » If you import data from Excel, make sure to: Put variable names in the first row Code your categorical data first, then import codes » If you choose to code missing data: First, replace all missing values with the code Second, define the missing value code in the Variable View ASK at Brunel (2014) 76
74. 74. Dr.ChristinePereira » SPSS Survival Manual, 4th Edition (2010) by Julie Pallant. » SPSS Survival Manual, 5th Edition (2013) by Julie Pallant. » Discovering Statistics Using SPSS, 3rd Edition (2009) by Andy Field. » Discovering Statistics Using SPSS, 4th Edition (2013) by Andy Field. ASK at Brunel (2014) 77
75. 75. Dr.ChristinePereira ASK at Brunel (2014) 78