DATA PREPARATION
AND
PROCESSING
1
DATA PREPARATION
• Once data is collected, process of analysis
begins.
• But, data has to be translated in an appropriate
form.
• This process is known as Data Preparation
2
STEPS IN DATA PREPARATION
• Validate data
• Questionnaire checking
• Edit acceptable questionnaires
• Code the questionnaires
• Keypunch the data
• Clean the data set
• Statistically adjust the data
• Store the data set for analysis
• Analyse data 3
VALIDATION
• Validity exists when the data actually measure
what they are suppose to measure. If they fail
to, they are misleading and should not be
accepted.
• One of the most serious concerns is errors in
survey data.
• When secondary data are involved, they may
be ancient or unimportant.
• With primary data also, this review is
important.
4
QUESTIONNAIRE CHECKING
• A questionnaire returned from the field may be
unacceptable for several reasons.
– Parts of the questionnaire may be
incomplete. Inadequate answers. No
responses to specific questions
– The pattern of responses may indicate that
the respondent did not understand or follow
the instructions.
– The responses show little variance.
– One or more pages are missing. 5
QUESTIONNAIRE CHECKING
– The questionnaire is answered by someone
who does not qualify for participation.
– Fictitious interviews
– Inconsistencies
– Illegible responses
– Yea- or nay-saying patterns
– Middle-of-the-road patterns 6
EDITING
• Next phase of data preparation involves
editing of the raw data.
• Three basic approaches:
- Go back to the respondents for clarification
- Infer from other responses
- Discard the response altogether
7
Treatment of Unsatisfactory Responses
Treatment of
Unsatisfactory
Responses
Return to the Assign Missing Discard
Unsatisfactory
Field Values Respondents
Substitute a Casewise Pairwise
Neutral Value Deletion Deletion
8
Treatment of Unsatisfactory Results:
- Returning to the Field – The
questionnaires with unsatisfactory responses
may be returned to the field, where the
interviewers recontact the respondents.
- Assigning Missing Values – If returning the
questionnaires to the field is not feasible, the
editor may assign missing values to
unsatisfactory responses.
- Discarding Unsatisfactory Respondents –
In this approach, the respondents with
unsatisfactory responses are simply 9 discarded
CODING
• Data entry refers to the creation of a
computer file that holds the raw data taken
from all of the questionnaires deemed suitable
for analysis
• Coding means assigning a code, usually a
number, to each possible response to each
question. The code includes an indication of
the column position (field) and data record it
will occupy. 10
CODING
• Fixed field codes, which mean that the
number of records for each respondent is the
same and the same data appear in the same
column(s) for all respondents, are highly
desirable.
– If possible, standard codes should be used
for missing data. Coding of structured
questions is relatively simple, since the
response options are predetermined.
11
CODING
– In questions that permit a large number of
responses, each possible response option
should be assigned a separate column.
– Guidelines for coding unstructured questions:
– Category codes should be mutually exclusive and
collectively exhaustive.
– Only a few (10% or less) of the responses should fall into
the “other” category.
– Category codes should be assigned for critical issues even
if no one has mentioned them.
– Data should be coded to retain as much detail
12 as possible.
CODING
• Principles for establishing categories for
coding:
- Convenient number of categories
- Similar responses within categories
- Differences of responses between categories
- Mutually exclusive categories
- Exhaustive categories
- Avoid open-ended class intervals
- Class interval of the same width
- Midpoints of class intervals 13
CODE BOOK
• A codebook contains coding instructions and
the necessary information about variables in
the data set. A codebook generally contains
the following information:
- column number
- record number
- variable number
- variable name
- question number
14
- instructions for coding
CODE BOOK
• Thus, a Data code book identifies all of the
variable names and code numbers associated
with each possible response to each question
that makes up the data set
15
Restaurant Preference
ID PREFER. QUALITY QUANTITY VALUE SERVICE INCOME
1 2 2 3 1 3 6
2 6 5 6 5 7 2
3 4 4 3 4 5 3
4 1 2 1 1 2 5
5 7 6 6 5 4 1
6 5 4 4 5 4 3
7 2 2 3 2 3 5
8 3 3 4 2 3 4
9 7 6 7 6 5 2
10 2 3 2 2 2 5
11 2 3 2 1 3 6
12 6 6 6 6 7 2
13 4 4 3 3 4 3
14 1 1 3 1 2 4
15 7 7 5 5 4 2
16 5 5 4 5 5 3
17 2 3 1 2 3 4
18 4 4 3 3 3 3
19 7 5 5 7 5 5
20 3 2 2 3 16
3 3
A Codebook Excerpt
Column Variable Variable Question Coding
Number Number Name Number Instructions
1 1 ID 1 to 20 as coded
2 2 Preference 1 input the number circled.
1=Weak Preference
7=Strong Preference
3 3 Quality 2 Input the number circled.
1=Poor
7=Excellent
4 4 Quantity 3 Input the number circled.
1=Poor
7=Excellent
17
A Codebook Excerpt
Column Variable Variable Question Coding
Number Number Name Number Instructions
5 5 Value 4 Input the number circled.
1=Poor
7=Excellent
6 6 Service 5 Input the number circled.
1=Poor
7=Excellent
7 7 Income 6 Input the number circled.
1 = Less than $20,000
2 = $20,000 to 34,999
3 = $35,000 to 49,999
4 = $50,000 to 74,999
5 = $75,000 to 99,999
6 = $100,00 or more
18
SPSS Variable View of the Data of Table
19
Keypunch the data / Data
transcription
• Transcribing data is the process of
transferring the coded data from the
questionnaire or coding sheets onto
disks or magnetic tapes or directly into
computers by keypunching.
20
Keypunch the data / Data transcription
Raw Data
CATI / Keypunching via Mark Sense Optical Computerized
CAPI CRT Terminal Forms Scanning Sensory
Analysis
Verification:Correct
Keypunching Errors
Magnetic
Computer Disks
Memory Tapes
Transcribed Data 21
Data Cleaning
• Consistency Checks
- Consistency checks identify data that are out of
range, logically inconsistent, or have extreme
values.
- Computer packages like SPSS, SAS, EXCEL and
MINITAB can be programmed to identify out-of-
range values for each variable and print out the
respondent code, variable code, variable name,
record number, column number, and out-of-range
value.
- Extreme values should be closely examined.
22
Data Cleaning
• Treatment of Missing Responses
• Substitute a Neutral Value – A neutral value, typically the
mean response to the variable, is substituted for the missing
responses.
• Substitute an Imputed Response – The respondents' pattern
of responses to other questions are used to impute or
calculate a suitable response to the missing questions.
• In case wise deletion, cases, or respondents, with any
missing responses are discarded from the analysis.
• In pair wise deletion, instead of discarding all cases with
any missing values, the researcher uses only the cases or
respondents with complete responses for each calculation.
23
Statistically Adjusting the Data
• Weighting
• In weighting, each case or respondent in the
database is assigned a weight to reflect its
importance relative to other cases or respondents.
• Weighting is most widely used to make the sample
data more representative of a target population on
specific characteristics.
• Yet another use of weighting is to adjust the
sample so that greater importance is attached to
respondents with certain characteristics.
24
Statistically Adjusting the Data
Use of Weighting for Representativeness
Years of Sample Population
Education Percentage Percentage Weight
Elementary School
0 to 7 years 2.49 4.23 1.70
8 years 1.26 2.19 1.74
High School
1 to 3 years 6.39 8.65 1.35
4 years 25.39 29.24 1.15
College
1 to 3 years 22.33 29.42 1.32
4 years 15.02 12.01 0.80
5 to 6 years 14.94 7.36 0.49
7 years or more 12.18 6.90 0.57
Totals 100.00 100.00 25
Statistically Adjusting the Data
• Variable Respecification
• Variable respecification involves the transformation of
data to create new variables or modify existing
variables.
• E.G., the researcher may create new variables that are
composites of several other variables.
• Dummy variables are used for respecifying categorical
variables. The general rule is that to respecify a
categorical variable with K categories, K-1 dummy
variables are needed
26
Statistically Adjusting the Data
Product Usage Original Dummy Variable Code
Category Variable
Code X1 X2 X3
Nonusers 1 1 0 0
Light users 2 0 1 0
Medium users 3 0 0 1
Heavy users 4 0 0 0
Note that X1 = 1 for nonusers and 0 for all others. Likewise, X2 =
1 for light users and 0 for all others, and X3 = 1 for medium users
and 0 for all others. In analyzing the data, X1, X2, and X3 are
used to represent all user/nonuser groups
27
Statistically Adjusting the Data
• Scale Transformation and Standardization:
- Scale transformation involves a manipulation of scale
values to ensure comparability with other scales or
otherwise make the data suitable for analysis.
- A more common transformation procedure is
standardization. Standardized scores, Zi, may be
obtained as:
Zi = (Xi -X )/sx
28
A Classification of Univariate Techniques
Univariate Techniques
Metric Data Non-numeric Data
One Sample Two or More One Sample Two or More
Samples Samples
* t test * Frequency
* Z test * Chi-Square
* K-S
* Runs
* Binomial
Independent Related
Independent Related
* Two- Group test * Paired
* Z test t test * Chi-Square * Sign
* One-Way * Mann-Whitney * Wilcoxon
ANOVA * Median * McNemar
* K-S * Chi-Square
* K-W ANOVA29
A Classification of Multivariate Techniques
Multivariate Techniques
Dependence Interdependence
Technique Technique
One Dependent More Than One Variable Interobject
Variable Dependent Interdependence Similarity
Variable
* Cross- * Multivariate * Factor * Cluster Analysis
Tabulation Analysis of Analysis * Multidimensional
* Analysis of Variance and Scaling
Variance and Covariance
Covariance * Canonical
* Multiple Correlation
Regression * Multiple
* Conjoint Discriminant
Analysis Analysis
30