How to enter data in SPSS

Slides:



Advertisements
Similar presentations
Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Advertisements

Data Analysis using SPSS By Dr. Shaik Shaffi Ahamed Ph. D
Entering Data for Analysis Annie Herbert Medical Statistician Research & Development Support Unit Salford Royal (Hope) Hospitals NHS Foundation Trust
Introduction to SPSS Allen Risley Academic Technology Services, CSUSM
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
Exploring Microsoft Excel 2002 Chapter 7 Chapter 7 List and Data Management: Converting Data to Information By Robert T. Grauer Maryann Barber Exploring.
1 An Introduction to IBM SPSS PSY450 Experimental Psychology Dr. Dwight Hennessy.
A Simple Guide to Using SPSS© for Windows
Chapter 7 Data Management. Agenda Database concept Import data Input and edit data Sort data Function Filter data Create range name Calculate subtotal.
Introduction to SPSS Descriptive Statistics. Introduction to SPSS Statistics Program for the Social Sciences (SPSS) Commonly used statistical software.
SPSS 1: An Introduction to the Statistical Package SPSS Suzie Cro MRC Clinical Trials Unit.
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
Introduction to SPSS Short Courses Last created (Feb, 2008) Kentaka Aruga.
SPSS 202: Data Management by SPSS (Workshop) Dr. Daisy Dai Department of Medical Research 1.
Basic Concept of Data Coding Codes, Variables, and File Structures.
Introduction to SPSS (For SPSS Version 16.0)
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Managing Your Own Data (…if you have to) Kathryn A. Carson, Sc.M. Senior Research Associate Department of Epidemiology Johns Hopkins Bloomberg School of.
Managing Business Data Lecture 8. Summary of Previous Lecture File Systems  Purpose and Limitations Database systems  Definition, advantages over file.
Coding for Excel Analysis Optional Exercise Map Your Hazards! Module, Unit 2 Map Your Hazards! Combining Natural Hazards with Societal Issues.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
Gadgets & More…. “Date Range” Gadgets Allows you to choose a specific date, before or after a date or a range of dates using the Workflows calendar.
Chapter 10: Working with Large Data Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Data Analysis Using SPSS
Data Collection Tools and Creation of a Usable Database Adam Schlichting University of Illinois at Chicago Department of Emergency Medicine Last updated:
1 Lesson 22 Getting Started with Access Essentials Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Introduction to SPSS Edward A. Greenberg, PhD
 Starting Excel 2003  Using Help  Workbook Management  Cursor Management  Manipulating Data  Using Formulae and Functions  Formatting Spreadsheet.
Creating a Web Site to Gather Data and Conduct Research.
LINDSEY BREWER CSSCR (CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH) UNIVERSITY OF WASHINGTON September 17, 2009 Introduction to SPSS (Version 16)
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Lesson 17 Getting Started with Access Essentials
TIMES 3 Technological Integrations in Mathematical Environments and Studies Jacksonville State University 2010.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Entering Data Manually PowerPoint Prepared by.
Key Applications Module Lesson 21 — Access Essentials
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 23 Getting Started with Access Essentials 1 Morrison / Wells / Ruffolo.
Microsoft Access 2010 Chapter 10 Administering a Database System.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
Excel 2007 Part (3) Dr. Susan Al Naqshbandi
Lesson 13 Databases Unit 2—Using the Computer. Computer Concepts BASICS - 22 Objectives Define the purpose and function of database software. Identify.
Chapter 3 Automating Your Work. It is frustrating when you have to type the same passage of text repeatedly. For example your name and address. Word includes.
Overview Excel is a spreadsheet, a grid made from columns and rows. It is a software program that can make number manipulation easy and somewhat painless.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
Microsoft® Excel Create an Excel table. 1 Work with the Table Tools Design tab. 2 Sort and filter records in a table. 3 Identify structured references.
Using SPSS Next. An Introduction SPSS (the Statistical Package for the Social Sciences)
Excel part 5 Working with Excel Tables, PivotTables, and PivotCharts.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Use SPSS for solving the problems Lecture#21. Opening SPSS The default window will have the data editor There are two sheets in the window: 1. Data view2.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 PEER Session 02/04/15. 2  Multiple good data management software options exist – quantitative (e.g., SPSS), qualitative (e.g, atlas.ti), mixed (e.g.,
Analyzing Data. Learning Objectives You will learn to: – Import from excel – Add, move, recode, label, and compute variables – Perform descriptive analyses.
IENG-385 Statistical Methods for Engineers SPSS (Statistical package for social science) LAB # 1 (An Introduction to SPSS)
Data Entry, Coding & Cleaning SPSS Training Thomas Joshua, MS July, 2008.
SPSS For a Beginner CHAR By Adebisi A. Abdullateef
GO! with Microsoft Office 2016
Downloading and Preparing a StudentVoice File for SPSS
Introduction to SPSS.
GO! with Microsoft Access 2016
DEPARTMENT OF COMPUTER SCIENCE
ECONOMETRICS ii – spring 2018
Data Entry and Managment
Spreadsheets, Modelling & Databases
Lesson 13 Working with Tables
Presentation transcript:

How to enter data in SPSS 1.1 Introduction of SPSS 1.2 Data Entry 1.3 Data Cleaning using SPSS

Statistical Software Packages Most Commonly Cited in the NEJM and JAMA between 1998 and 2002 SAS 302 SPSS 87 STATA 80 Epi Info 49 SUDAAN 43 S-PLUS 33 StatXact 18 BMDP 9 StatView 9 Statistica 8 100 200 300 400 Number of articles software was sited

Master in Clinical Bio-Medical Science Program Biostatistics I, Year 2006 Ayumi Shintani, Ph.D., M.P.H. Before you perform analysis in SPSS, let’s set up the following option. Go to Edit, Options,.. Chapter 1

SPSS Windows has 3 windows: Data Editor Viewer or Draft Viewer which displays the output files Syntax Editor, which displays syntax files The Data Editor has two parts: Data View window, which displays data from the active file in spreadsheet format Variable View window, which displays metadata or information about the data in the active file, such as variable names and labels, value labels, formats, and missing value indicators.

SPSS Data View

SPSS Variable View

1.2 Data Entry into SPSS There are 2 ways to enter data into SPSS: 1. Directly enter in to SPSS by typing in Data View 2. Enter into other database software such as Excel then import into SPSS Let’s start with the second option, using data in Excel.

Figure 1. Data from Hell

Data from Heaven

How to move from Hell to Heaven (1): 1. Add a patient’ ID number 2. Delete the first row with the title of the project 3. Delete the 2 rows under the variable name. 4. Delete the 2 row between the groups. 5. Delete the row of average at the bottom. 6. Add a variable called group and code the first 10 with Drug A as 1 and the next 10 as 2. 7. Change the variable names to less than 8 or 8 characters with no spaces, (you can use numeric, but not starting with numeric, avoid symbols). 8. Insert 2 columns before BP as SYSBP and DIASBP. Delete the BP text column. 9. Change missing values, NA, unknown, ?, to blanks. 10. Change age of 6 months to 0.5 (years). Fix errors. 11. Code males=1 and females=2. 12. Code complications as 0 for no and 1 for yes 13. Go back to the source and complete the missing information 14. If a column was entered as a string (words), you may have to select the column and format the cells for change it to numeric.

General guidelines for data entry 1. Give each variable a valid name (8 characters or less with no spaces or punctuation, beginning with a letter not a numeric number). Short, easy to remember word names. Avoid the following variable names: TEST, ALL, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, WITH. These are used in the SPSS syntax and if they were permitted, the software would not be able to distinguish between a command and a variable. Each variable name must be unique; duplication is not allowed. Variable names are not case sensitive. The names NEWVAR, NewVar, and newvar are all considered identical. 2. Encode categorical variables. Convert letters and words to numbers. 3. Avoid mixing symbols with data. Convert them to numbers. 4. Give each patient a unique, sequential case number (ID). Place this ID number in the first column on the left

5. Each variable should be in its own column. Change to: Animal Group 1 0 2 0 3 1 4 1 Avoid this: Animal Control1 Control2 Experiment1 Experiment2 * Do not combine variables in one column * It is recommended to use 0/1 for 2 groups with 0 as a reference group. 6. All data for a project should be in one spreadsheet. Do not include graphs or summary statistics in the spreadsheet.

7. Each patient should be entered on a single line or row 7. Each patient should be entered on a single line or row. Do not copy a patient’s information to another row to perform subgroup analysis. 8. However when data are repeatedly collected over a patient, it’s recommended to have patient-day observation on a simple line to ease data management. SPSS has a nice feature to convert from the longitudinal format to horizontal format. When the number of repeats are few 2 or 3, horizontal format may be preferred for simplicity. Longitudinal data entry Horizontal data entry Date ID SYSBP 1/2/2005 1 130 1/3/2005 1 120 1/4/2005 1 120 3/1/2005 2 110 3/2/2005 2 140 ID SYSBP1 SYSBP2 SYSBP3 1 130 120 120 2 110 140

9. For yes/no questions, enter “0” for no and “1” for yes 9. For yes/no questions, enter “0” for no and “1” for yes. Do not leave blanks for no. Do not enter “?”, “*”, or “NA” for missing data because this indicates to the statistical program than the variable is a string variable. String variables cannot be used for any arithmetic computation. 10. Put ordinal variables into one column if they are mutually exclusive. Preferred: Pain 1 2 3 Avoid: Pain Mild Moderate Severe 1 0 0 0 1 0 0 0 1 11. Do not make columns wider then 8 characters, unless absolutely essential.

Entering Date in Excel. In Excel,go to: Format, Cells, select Date under Category, Choose Type for a format you like

Entering Time in Excel. In Excel, go to: Format, Cells, select Time under Category, Choose Type for a format you like

Format, Cells, select Time under Category, Choose Data/Time format Entering Date / Time in Excel. In Excel, go to: Format, Cells, select Time under Category, Choose Data/Time format

Entering Date, Time in SPSS In SPSS, open Variable View, Click Type for the variable you want to Assign date format, click on Date, and select a format of your choice.

Importing data from Excel spreadsheet into SPSS. In SPSS, go to: File, Open, Data Select Type of file (for example, Excel) you want to open Select File name you want to open

Importing data from SPSS to Excel. In SPSS, go to: Data, Save as, Select Type of file (for example, Excel) you want to save into Give File name you want to save into

Data merging in SPSS (1) Make sure that both files are sorted by Key variable in ascending order In SPSS, open Data from Hell to Heaven.sav Select Add Variables under Data, Merge Files

Data merging in SPSS (2) 4. Select the dataset you want to merge into the working file.

Data merging in SPSS (3) Click on Match cases on key variables in sorted files, Click on Both files provide cases Highlight ID in the excluded variables box, then click ► near key Variables

Note in Data merging in SPSS (3) Cases must be sorted in the same order in both data files. If one or more key variables are used to match cases, the two data files must be sorted by ascending order of the key variable. Variable names in the second data file that duplicate variable names in the working data file are excluded by default because Add Variables assumes that these variables contain duplicate information. Thus before you merge data files, you need carefully to check two variables with the same name. If two variables contain different information, SPSS automatically delete variable from the file, which is being merged into (Birthday.sav).

1.3 Data Cleaning in SPSS 1. Re-coding existing variables 2. Creating new variables 3. Creating new variable from existing variables 4. Data labeling and formatting

Data cleaning in SPSS (1): Recoding existing variables (1) We want to use numeric coding for group instead of A and B. Old New ID Group Group 1 A 0 2 A 0 3 B 1 4 B 1

Data cleaning in SPSS (2): Recoding existing variables (2) From SPSS dialog box, go to: Transform Recode Into Same variables

Data cleaning in SPSS (1): Recoding existing variables (3) 1. Select Group from the variable box into String Variables box 2. Click on Old and new Values to proceed

Data cleaning in SPSS (1): Recoding existing variables (4) 1. Type the old value and the new value you want to convert into 2. Click on Add (To remove, or change, click on Change or Remove) 3. Type all values in the Old  New box, then click Continue 4. Click OK to execute the commands.

Data Cleaning in SPSS (2) Creating a new variable for Diastolic blood pressure (DiasBP): In SPSS, go to Variable View, Then type DiasBP at the last row under Name Go back to Data View and directly type diastolic blood pressure to separate from SysBP. For ease of data entry, you can move DiasBP right after SysBP. Now also edit sysBP.

Data Cleaning in SPSS (3) Computing patient’s age from birthday and date enrolled into the study.

Data Cleaning in SPSS (4): Data labeling and formatting (1) Specifying Type of Variable HT 61.00 68.00 47.00 66.00 72.00 67.00 60.00 59.00 73.00 65.00 71.00 69.00

Data Cleaning in SPSS (4): Data labeling and formatting (2)

Data Cleaning in SPSS (4): Data labeling and formatting (3) Variable Formatting

Data Cleaning in SPSS (4): Data labeling and formatting (4) Specifying missing values

Data Cleaning in SPSS (4): Data labeling and formatting (5) Measurement category

Retrieve data property from existing files in SPSS (1) This property is extremely handy when you need to construct a similar database for expanded, or new group of patients. You can save time on creating variable label, format, etc, rather you can retrieve these information from existing files. Now let’s create a copy from “Data from heaven.sav” after you delete formats and labels you just created. Save it as “Data from hell to heaven without format.sav”. Modified Note: Before you perform this commands, make sure that Type of variables matched between the two datasets.

Retrieve data property from existing files in SPSS (2)

Retrieve data property from existing files in SPSS (3)

Using syntax in SPSS: SPSS has its great advantage in producing high level graphs and statistical analysis by easy point-and-click operations. However, some people may criticize SPSS for irreproducibility of analysis which were conducted before. In fact, SPSS has a high level capacity of programming syntax which can be saved and repeatedly operated. Throughout the course, I will provide “how to” box to conduct all analysis used in the class, here I will show how to save your commands in syntax. I highly recommend the use of syntax for better organization on haw has been done.

Using syntax in SPSS (1): Creating a new syntax file

Using syntax in SPSS (2): Editing a syntax file

Using syntax in SPSS (3): Saving a syntax file

Using syntax in SPSS (4): Opening an existing syntax

Using a syntax in SPSS (5): Example Syntax I find syntax very handy especially when you get tired of clicking so many times!

Using syntax in SPSS (6):Recoding syntax from command dialog box You can in fact use command dialog box (point and click method) as your main tool and still save what you did with point and click into syntax. Then later you can simply execute the syntax to repeat the analysis. Step 1

Step 2: Saved syntax from the previous PASTE command

Using syntax in SPSS (7): Executing the syntax

Data confidentiality Data need to be stored in a secure locked place, need to be back-up daily or once a week. When you send your data to a biostatistician for further statistical analysis, delete patient name, social security numbers, medical record numbers, actual dates (birth day, admission date, etc)

Communication with a biostatistician: Most statisticians prefer to have data submitted as SPSS format or in the statistical software they use. An advantage of entering data directly into a statistical package, such as SPSS is that one can enter variable label and value labels in the file. When communicating with a biostatistician, also describe the research problem, study hypothesis, and the primary comparison that you are interested in. Explain any variables that need to be controlled for. Explain the code used for missing values. Also answer the following questions: What is the name of your study? What is the purpose of your study? What is the type of your study? Will all subjects be included in the analysis? Was there any matched (repeated) measures? How will outliers be defined and handled? Has the data been cleaned? What is our goal and deadline for this goal?