SlideShare a Scribd company logo
Data Entry in Excel and
SPSS + Basic Data
manipulation
Dhritiman Chakrabarti
Assistant Professor,
Dept of Neuroanaesthesiology
and Neurocritical Care,
NIMHANS, Bangalore
SPSS Windows has 3 windows:
Data Editor
Syntax Editor, which displays syntax files
Viewer or Draft Viewer which displays the output 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.
What you shouldn’t do – A statistician’s Hell
7
What you should do – A statistician’s Heaven..
8
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.
First row is always Variable name. Second row onwards always contains
the patient/sample.
General guidelines for data entry into Excel
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
9
5. Each variable should be in its own column.
Avoid this:
Animal
Control1
Control2
Experiment1
Experiment2
Change to:
Animal Group
1 0
2 0
3 1
4 1
* It is recommended to use 0/1 for 2 groups with 0 as a reference group.
* Do not combine variables in one column
6. All data for a project should be in one spreadsheet.
7. Do not include graphs or summary statistics in the spreadsheet – Only
raw data.
10
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 (Long format) to horizontal format (Wide format) – Data
Restructuring. When the number of repeats are few 2 or 3, horizontal
format may be preferred for simplicity.
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
Longitudinal data entry
ID SYSBP1 SYSBP2 SYSBP3
1 130 120 120
2 110 140
Horizontal data entry
7. Each patient should be entered on a single line or row.
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.
11
Entering Date in Excel.
In Excel,go to:
Format, Cells, select Date under Category,
Choose Type for a format you like
12
Entering Time in Excel.
In Excel, go to:
Format, Cells, select Time under Category,
Choose Type for a format you like
13
Entering Date / Time in Excel.
In Excel, go to:
Format, Cells, select Time under Category,
Choose Data/Time format
14
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.
15
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
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
17
Data cleaning in SPSS (1): Recoding existing variables (1)
Old New
ID Group Group
1 A 0
2 A 0
3 B 1
4 B 1
We want to use numeric coding for group instead of A and B.
18
Data cleaning in SPSS (2): Recoding existing variables (2)
From SPSS dialog box, go to:
Transform
Recode
Into Same variables (better to recode into different variable)
19
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 (3)
20
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 (1): Recoding existing variables (4)
21
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.
Data Cleaning in SPSS (3)
Computing New variable from Existing variable(s)
Transform  Compute Variable  this window (Computing MAPB from SBPB
And DBPB
23
HT
61.00
68.00
47.00
66.00
72.00
67.00
72.00
72.00
66.00
60.00
61.00
59.00
73.00
65.00
71.00
68.00
69.00
66.00
66.00
68.00
Data Cleaning in SPSS (4): Data labeling and formatting (1)
Specifying Type of Variable
24
Data Labeling
Data Cleaning in SPSS (4): Data labeling and formatting (2)
25
Variable Formatting – For Categorical variables
Data Cleaning in SPSS (4): Data labeling and formatting (3)
26
Data Cleaning in SPSS (4): Data labeling and formatting (5)
Measurement category – Interval (Scale); Ordinal; Nominal

More Related Content

PPTX
Accounting Information System (AIS)
Osareme Erhomosele
 
PPT
Research design and types of research design final ppt
Prahlada G
 
PPTX
Email writing
Dr.Nidhi pandey
 
PPTX
Diplomacy defined
leadershipmgtservice
 
PPTX
Amoebiasis pathogenesis and pathology
Abhishek Uday Kumar
 
PPT
Cyber crime and fraud
FCA - Future Chartered Accountants
 
PPTX
t test using spss
Parag Shah
 
PDF
Codex-Gigas-In-English.pdf
Raisulrahat2
 
Accounting Information System (AIS)
Osareme Erhomosele
 
Research design and types of research design final ppt
Prahlada G
 
Email writing
Dr.Nidhi pandey
 
Diplomacy defined
leadershipmgtservice
 
Amoebiasis pathogenesis and pathology
Abhishek Uday Kumar
 
Cyber crime and fraud
FCA - Future Chartered Accountants
 
t test using spss
Parag Shah
 
Codex-Gigas-In-English.pdf
Raisulrahat2
 

What's hot (20)

PPTX
F test and ANOVA
Parag Shah
 
PPT
Descriptive statistics ppt
Titus Mutambu Mweta
 
PPTX
Cluster analysis
saba khan
 
PPTX
DATA Types
Aniruddha Deshmukh
 
PPT
Software packages for statistical analysis - SPSS
ANAND BALAJI
 
PPTX
Multivariate data analysis
Setia Pramana
 
PDF
Scales of Measurement - Statistics
Thiyagu K
 
PPTX
Research design
Jithin Thomas
 
PPTX
Factor analysis
saba khan
 
PPT
Introduction To SPSS
Phi Jack
 
PPTX
Basics stat ppt-types of data
Farhana Shaheen
 
PPT
T test statistics
Mohammad Ihmeidan
 
PPTX
Levels of Measurement
Sr Edith Bogue
 
PPT
Regression analysis ppt
Elkana Rorio
 
PPTX
RESEARCH METHODOLOGY- PROCESSING OF DATA
jeni jerry
 
PPTX
Data analysis and working on spss
Dr. Senthilvel Vasudevan
 
PPTX
Research Methodology - types of scale
Karpagam Alagappan
 
PPTX
Measurement & scaling ,Research methodology
SONA SEBASTIAN
 
PPTX
Correlation ppt...
Shruti Srivastava
 
PPTX
Correlation and partial correlation
Udaybhaskar Mogallapu
 
F test and ANOVA
Parag Shah
 
Descriptive statistics ppt
Titus Mutambu Mweta
 
Cluster analysis
saba khan
 
DATA Types
Aniruddha Deshmukh
 
Software packages for statistical analysis - SPSS
ANAND BALAJI
 
Multivariate data analysis
Setia Pramana
 
Scales of Measurement - Statistics
Thiyagu K
 
Research design
Jithin Thomas
 
Factor analysis
saba khan
 
Introduction To SPSS
Phi Jack
 
Basics stat ppt-types of data
Farhana Shaheen
 
T test statistics
Mohammad Ihmeidan
 
Levels of Measurement
Sr Edith Bogue
 
Regression analysis ppt
Elkana Rorio
 
RESEARCH METHODOLOGY- PROCESSING OF DATA
jeni jerry
 
Data analysis and working on spss
Dr. Senthilvel Vasudevan
 
Research Methodology - types of scale
Karpagam Alagappan
 
Measurement & scaling ,Research methodology
SONA SEBASTIAN
 
Correlation ppt...
Shruti Srivastava
 
Correlation and partial correlation
Udaybhaskar Mogallapu
 
Ad

Similar to Data entry in Excel and SPSS (20)

PPT
How_to_Enter_Data_in_SPSS data Analysis.ppt
chesenybrian2022
 
PPT
Spps training presentation 1
Hassen Mohammed
 
PPTX
SPSS software
VinodBaithaVinodSir
 
PPTX
Spss by vijay ambast
Vijay Ambast
 
PDF
Introduction to spss
Subodh Khanal
 
PDF
Spss basics tutorial
santoshranjan77
 
PPTX
Data Coding and Data Management using SPSS
Melba Shaya Sweety
 
DOC
Spss notes
sitifatimahcheosmi
 
PPT
6967176.ppt
ThemovieCorner
 
PDF
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
Nitish Nagar
 
PDF
spss presentation.pdf
AbebeNega
 
PPT
Advanced Excel ppt
Sudipta Mazumder
 
PPT
Spss guidelines
APPOLINAIRE BIZIMANA
 
PDF
SPSS GUIDE
Siti Mastura
 
PPTX
MS Excel 2010 Most Important Features
hb_23
 
PPT
An introduction to spss
zeeshanwrch
 
PPTX
spss teaching
lalit pratpa singh singh
 
PDF
Formulas in ms excel for statistics(report2 in ict math ed)
Caryl Mae Puertollano
 
PDF
Spss tutorial 1
debataraja
 
PDF
Spss tutorial 1
kunkumabala
 
How_to_Enter_Data_in_SPSS data Analysis.ppt
chesenybrian2022
 
Spps training presentation 1
Hassen Mohammed
 
SPSS software
VinodBaithaVinodSir
 
Spss by vijay ambast
Vijay Ambast
 
Introduction to spss
Subodh Khanal
 
Spss basics tutorial
santoshranjan77
 
Data Coding and Data Management using SPSS
Melba Shaya Sweety
 
Spss notes
sitifatimahcheosmi
 
6967176.ppt
ThemovieCorner
 
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
Nitish Nagar
 
spss presentation.pdf
AbebeNega
 
Advanced Excel ppt
Sudipta Mazumder
 
Spss guidelines
APPOLINAIRE BIZIMANA
 
SPSS GUIDE
Siti Mastura
 
MS Excel 2010 Most Important Features
hb_23
 
An introduction to spss
zeeshanwrch
 
Formulas in ms excel for statistics(report2 in ict math ed)
Caryl Mae Puertollano
 
Spss tutorial 1
debataraja
 
Spss tutorial 1
kunkumabala
 
Ad

More from Dhritiman Chakrabarti (20)

PPTX
For crossover designs
Dhritiman Chakrabarti
 
PPTX
Logistic regression analysis
Dhritiman Chakrabarti
 
PPTX
Agreement analysis
Dhritiman Chakrabarti
 
PPTX
Linear regression analysis
Dhritiman Chakrabarti
 
PPTX
Inferential statistics correlations
Dhritiman Chakrabarti
 
PPTX
Inferential statistics quantitative data - single sample and 2 groups
Dhritiman Chakrabarti
 
PPTX
Inferential statistics nominal data
Dhritiman Chakrabarti
 
PPTX
Inferential statistics quantitative data - anova
Dhritiman Chakrabarti
 
PPTX
Types of variables and descriptive statistics
Dhritiman Chakrabarti
 
PPTX
Study designs, randomization, bias errors, power, p-value, sample size
Dhritiman Chakrabarti
 
PPTX
Anaesthesia for functional neurosurgery
Dhritiman Chakrabarti
 
PPTX
Epilepsy and anaesthesia
Dhritiman Chakrabarti
 
PPTX
Icp monitoring seminar
Dhritiman Chakrabarti
 
PPTX
Caeserean section complicated by mitral stenosis
Dhritiman Chakrabarti
 
PPTX
Bronchospasm during induction
Dhritiman Chakrabarti
 
PPTX
Bronchial blockers & endobronchial tubes
Dhritiman Chakrabarti
 
PPTX
Breathing systems
Dhritiman Chakrabarti
 
PPT
Brachial plexus block
Dhritiman Chakrabarti
 
PPTX
Bougie, trachlite , laryngeal tube , combitube , i gel ,truview
Dhritiman Chakrabarti
 
For crossover designs
Dhritiman Chakrabarti
 
Logistic regression analysis
Dhritiman Chakrabarti
 
Agreement analysis
Dhritiman Chakrabarti
 
Linear regression analysis
Dhritiman Chakrabarti
 
Inferential statistics correlations
Dhritiman Chakrabarti
 
Inferential statistics quantitative data - single sample and 2 groups
Dhritiman Chakrabarti
 
Inferential statistics nominal data
Dhritiman Chakrabarti
 
Inferential statistics quantitative data - anova
Dhritiman Chakrabarti
 
Types of variables and descriptive statistics
Dhritiman Chakrabarti
 
Study designs, randomization, bias errors, power, p-value, sample size
Dhritiman Chakrabarti
 
Anaesthesia for functional neurosurgery
Dhritiman Chakrabarti
 
Epilepsy and anaesthesia
Dhritiman Chakrabarti
 
Icp monitoring seminar
Dhritiman Chakrabarti
 
Caeserean section complicated by mitral stenosis
Dhritiman Chakrabarti
 
Bronchospasm during induction
Dhritiman Chakrabarti
 
Bronchial blockers & endobronchial tubes
Dhritiman Chakrabarti
 
Breathing systems
Dhritiman Chakrabarti
 
Brachial plexus block
Dhritiman Chakrabarti
 
Bougie, trachlite , laryngeal tube , combitube , i gel ,truview
Dhritiman Chakrabarti
 

Recently uploaded (20)

PDF
Key_Statistical_Techniques_in_Analytics_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Employee Salary Presentation.l based on data science collection of data
barridevakumari2004
 
PDF
CH2-MODEL-SETUP-v2017.1-JC-APR27-2017.pdf
jcc00023con
 
PPTX
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
PPTX
IP_Journal_Articles_2025IP_Journal_Articles_2025
mishell212144
 
PPTX
Short term internship project report on power Bi
JMJCollegeComputerde
 
PPTX
Probability systematic sampling methods.pptx
PrakashRajput19
 
PDF
Linux OS guide to know, operate. Linux Filesystem, command, users and system
Kiran Maharjan
 
PDF
Research about a FoodFolio app for personalized dietary tracking and health o...
AustinLiamAndres
 
PPTX
Introduction-to-Python-Programming-Language (1).pptx
dhyeysapariya
 
PDF
D9110.pdfdsfvsdfvsdfvsdfvfvfsvfsvffsdfvsdfvsd
minhn6673
 
PPTX
Complete_STATA_Introduction_Beginner.pptx
mbayekebe
 
PDF
202501214233242351219 QASS Session 2.pdf
lauramejiamillan
 
PDF
Mastering Financial Analysis Materials.pdf
SalamiAbdullahi
 
PPT
2009worlddatasheet_presentation.ppt peoole
umutunsalnsl4402
 
PPTX
Azure Data management Engineer project.pptx
sumitmundhe77
 
PPTX
Introduction to Biostatistics Presentation.pptx
AtemJoshua
 
PPT
Real Life Application of Set theory, Relations and Functions
manavparmar205
 
PPTX
Economic Sector Performance Recovery.pptx
yulisbaso2020
 
PPTX
INFO8116 - Week 10 - Slides.pptx big data architecture
guddipatel10
 
Key_Statistical_Techniques_in_Analytics_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Employee Salary Presentation.l based on data science collection of data
barridevakumari2004
 
CH2-MODEL-SETUP-v2017.1-JC-APR27-2017.pdf
jcc00023con
 
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
IP_Journal_Articles_2025IP_Journal_Articles_2025
mishell212144
 
Short term internship project report on power Bi
JMJCollegeComputerde
 
Probability systematic sampling methods.pptx
PrakashRajput19
 
Linux OS guide to know, operate. Linux Filesystem, command, users and system
Kiran Maharjan
 
Research about a FoodFolio app for personalized dietary tracking and health o...
AustinLiamAndres
 
Introduction-to-Python-Programming-Language (1).pptx
dhyeysapariya
 
D9110.pdfdsfvsdfvsdfvsdfvfvfsvfsvffsdfvsdfvsd
minhn6673
 
Complete_STATA_Introduction_Beginner.pptx
mbayekebe
 
202501214233242351219 QASS Session 2.pdf
lauramejiamillan
 
Mastering Financial Analysis Materials.pdf
SalamiAbdullahi
 
2009worlddatasheet_presentation.ppt peoole
umutunsalnsl4402
 
Azure Data management Engineer project.pptx
sumitmundhe77
 
Introduction to Biostatistics Presentation.pptx
AtemJoshua
 
Real Life Application of Set theory, Relations and Functions
manavparmar205
 
Economic Sector Performance Recovery.pptx
yulisbaso2020
 
INFO8116 - Week 10 - Slides.pptx big data architecture
guddipatel10
 

Data entry in Excel and SPSS

  • 1. Data Entry in Excel and SPSS + Basic Data manipulation Dhritiman Chakrabarti Assistant Professor, Dept of Neuroanaesthesiology and Neurocritical Care, NIMHANS, Bangalore
  • 2. SPSS Windows has 3 windows: Data Editor Syntax Editor, which displays syntax files Viewer or Draft Viewer which displays the output 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.
  • 5. 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.
  • 6. What you shouldn’t do – A statistician’s Hell
  • 7. 7 What you should do – A statistician’s Heaven..
  • 8. 8 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. First row is always Variable name. Second row onwards always contains the patient/sample. General guidelines for data entry into Excel 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
  • 9. 9 5. Each variable should be in its own column. Avoid this: Animal Control1 Control2 Experiment1 Experiment2 Change to: Animal Group 1 0 2 0 3 1 4 1 * It is recommended to use 0/1 for 2 groups with 0 as a reference group. * Do not combine variables in one column 6. All data for a project should be in one spreadsheet. 7. Do not include graphs or summary statistics in the spreadsheet – Only raw data.
  • 10. 10 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 (Long format) to horizontal format (Wide format) – Data Restructuring. When the number of repeats are few 2 or 3, horizontal format may be preferred for simplicity. 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 Longitudinal data entry ID SYSBP1 SYSBP2 SYSBP3 1 130 120 120 2 110 140 Horizontal data entry 7. Each patient should be entered on a single line or row. 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.
  • 11. 11 Entering Date in Excel. In Excel,go to: Format, Cells, select Date under Category, Choose Type for a format you like
  • 12. 12 Entering Time in Excel. In Excel, go to: Format, Cells, select Time under Category, Choose Type for a format you like
  • 13. 13 Entering Date / Time in Excel. In Excel, go to: Format, Cells, select Time under Category, Choose Data/Time format
  • 14. 14 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.
  • 15. 15 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
  • 16. 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
  • 17. 17 Data cleaning in SPSS (1): Recoding existing variables (1) Old New ID Group Group 1 A 0 2 A 0 3 B 1 4 B 1 We want to use numeric coding for group instead of A and B.
  • 18. 18 Data cleaning in SPSS (2): Recoding existing variables (2) From SPSS dialog box, go to: Transform Recode Into Same variables (better to recode into different variable)
  • 19. 19 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 (3)
  • 20. 20 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 (1): Recoding existing variables (4)
  • 21. 21 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.
  • 22. Data Cleaning in SPSS (3) Computing New variable from Existing variable(s) Transform  Compute Variable  this window (Computing MAPB from SBPB And DBPB
  • 24. 24 Data Labeling Data Cleaning in SPSS (4): Data labeling and formatting (2)
  • 25. 25 Variable Formatting – For Categorical variables Data Cleaning in SPSS (4): Data labeling and formatting (3)
  • 26. 26 Data Cleaning in SPSS (4): Data labeling and formatting (5) Measurement category – Interval (Scale); Ordinal; Nominal