Title: From Survey to Data to Analysis
1From Survey to Data to Analysis
Providing Social Science Data Services Jim
Jacobs, 2008
2The Survey Instument
Survey instrument Q1. enter zip code Q2.
enter Rs first name Q3. enter sex of R Q4.
What was your major in College? Q5. What was your
income last year? Q6. Did you go to church last
week?
3Answers to Questions
Zip Name Sex Major income church 29002 Wilma
F lit 0 y 99005 Barney M engin
10 n 99005 Betty F . 0 n 92005
Ethel F theater 1000 y 12534 Fred M. M PE
10000 y 12534 Lucy F lit 700
y 25000 Ricky M music 11000 y 20000 Fred A.
M dance 10500 n 15000 Ginger F math 9500
y
4Must anonymize the data!
Zip Name Sex Major income church 29002 Wilma
F lit 0 y 99005 Barney M engin
10 n 99005 Betty F . 0 n 92005
Ethel F theater 1000 y 12534 Fred M. M PE
10000 y 12534 Lucy F lit 700
y 25000 Ricky M music 11000 y 20000 Fred A.
M dance 10500 n 15000 Ginger F math 9500
y
5Must anonymize the data!
Zip Name Sex Major income church 29002 001
F lit 0 y 99005 002 M engin
10 n 99005 003 F . 0 n 92005
004 F theater 1000 y 12534 005 M PE
10000 y 12534 006 F lit 700
y 25000 007 M music 11000 y 20000 008
M dance 10500 n 15000 009 F math 9500
y
6Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
F lit 0 y 99005 002 M engin
10 n 99005 003 F . 0 n 92005
004 F theater 1000 y 12534 005 M PE
10000 y 12534 006 F lit 700
y 25000 007 M music 11000 y 20000 008
M dance 10500 n 15000 009 F math 9500
y
7Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
1 lit 0 y 99005 002 2 engin
10 n 99005 003 1 . 0 n 92005
004 1 theater 1000 y 12534 005 2 PE
10000 y 12534 006 1 lit 700
y 25000 007 2 music 11000 y 20000 008
2 dance 10500 n 15000 009 1 math 9500
y
8Change Text to Numeric Codes
The codebook mustdocument the numeric codes
used!For example Variable sex 1
female 2 male
Zip Name Sex Major income church 29002 001
1 lit 0 y 99005 002 2 engin
10 n 99005 003 1 . 0 n 92005
004 1 theater 1000 y 12534 005 2 PE
10000 y 12534 006 1 lit 700
y 25000 007 2 music 11000 y 20000 008
2 dance 10500 n 15000 009 1 math 9500
y
9Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
1 lit 0 y 99005 002 2 engin
10 n 99005 003 1 . 0 n 92005
004 1 theater 1000 y 12534 005 2 PE
10000 y 12534 006 1 lit 700
y 25000 007 2 music 11000 y 20000 008
2 dance 10500 n 15000 009 1 math 9500
y
10Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
1 0075 0 y 99005 002 2 engin
10 n 99005 003 1 . 0 n 92005
004 1 theater 1000 y 12534 005 2 PE
10000 y 12534 006 1 0075 700
y 25000 007 2 music 11000 y 20000 008
2 dance 10500 n 15000 009 1 math 9500
y
11Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
1 0075 0 y 99005 002 2 0070
10 n 99005 003 1 . 0 n 92005
004 1 0076 1000 y 12534 005 2 0001
10000 y 12534 006 1 0075 700
y 25000 007 2 0077 11000 y 20000 008
2 0078 10500 n 15000 009 1 0050 9500
y
12Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
1 0075 0 y 99005 002 2 0070
10 n 99005 003 1 . 0 n 92005
004 1 0076 1000 y 12534 005 2 0001
10000 y 12534 006 1 0075 700
y 25000 007 2 0077 11000 y 20000 008
2 0078 10500 n 15000 009 1 0050 9500
y
13Change Text to Numeric Codes
Zip Name Sex Major income church 29002 001
1 0075 0 1 99005 002 2 0070
10 2 99005 003 1 . 0 2 92005
004 1 0076 1000 1 12534 005 2 0001
10000 1 12534 006 1 0075 700
1 25000 007 2 0077 11000 1 20000 008
2 0078 10500 2 15000 009 1 0050 9500
1
14Change Text to Numeric Codes
Sometimes, evennumeric variablesare encoded in
ranges. For example Variable income 1
less than 1000 2 1000 - 4999 3 5000 -
10000 4 more than 10000 9 not reported
Zip Name Sex Major income church 29002 001
1 0075 0 1 99005 002 2 0070
10 2 99005 003 1 . 0 2 92005
004 1 0076 1000 1 12534 005 2 0001
10000 1 12534 006 1 0075 700
1 25000 007 2 0077 11000 1 20000 008
2 0078 10500 2 15000 009 1 0050 9500
1
15Change Text to Numeric Codes
Sometimes, evennumeric variablesare encoded in
ranges. For example Variable income 1
less than 1000 2 1000 - 4999 3 5000 -
10000 4 more than 10000 9 not reported
Zip Name Sex Major income church 29002 001
1 0075 1 1 99005 002 2 0070
1 2 99005 003 1 . 1 2 92005 004
1 0076 2 1 12534 005 2 0001
3 1 12534 006 1 0075 1 1 25000
007 2 0077 4 1 20000 008 2 0078
4 2 15000 009 1 0050 3 1
16Data Files do not need headers
Zip Name Sex Major income church 29002 001
1 0075 1 1 99005 002 2 0070
1 2 99005 003 1 . 1 2 92005 004
1 0076 2 1 12534 005 2 0001
3 1 12534 006 1 0075 1 1 25000
007 2 0077 4 1 20000 008 2 0078
4 2 15000 009 1 0050 3 1
17Data Files do not need headers
29002 001 1 0075 1 1 99005 002
2 0070 1 2 99005 003 1 .
1 2 92005 004 1 0076 2 1 12534
005 2 0001 3 1 12534 006 1
0075 1 1 25000 007 2 0077 4
1 20000 008 2 0078 4 2 15000 009
1 0050 3 1
18Data Files do not need extra space
29002 001 1 0075 1 1 99005 002
2 0070 1 2 99005 003 1 .
1 2 92005 004 1 0076 2 1 12534
005 2 0001 3 1 12534 006 1
0075 1 1 25000 007 2 0077 4
1 20000 008 2 0078 4 2 15000 009
1 0050 3 1
19Data Files do not need extra space
290020011 0075 1 1 990050022
0070 1 2 990050031 . 1 2
920050041 0076 2 1 125340052 0001
3 1 125340061 0075 1 1 250000072
0077 4 1 200000082 0078 4
2 150000091 0050 3 1
20Data Files do not need extra space
2900200110075 1 1
9900500220070 1 2 990050031. 1
2 9200500410076 2 1 1253400520001
3 1 1253400610075 1 1 2500000720077
4 1 2000000820078 4 2 1500000910050
3 1
21Data Files do not need extra space
29002001100751 1
99005002200701 2 990050031. 1 2
92005004100762 1 12534005200013 1
12534006100751 1 25000007200774
1 20000008200784 2 15000009100503 1
22Data Files do not need extra space
290020011007511
990050022007012 990050031. 12
920050041007621 125340052000131
125340061007511 250000072007741 200000082007842 1
50000091005031
23Codebook must document locations
290020011007511
990050022007012 990050031. 12
920050041007621 125340052000131
125340061007511 250000072007741 200000082007842 1
50000091005031
For example Variable sex location column
9 width 1
24Codebook must document locations
123456789
290020011007511
990050022007012 990050031. 12
920050041007621 125340052000131
125340061007511 250000072007741 200000082007842 1
50000091005031
For example Variable sex location column
9 width 1
25Codebook documents question, location, codes.
290020011007511
990050022007012 990050031. 12
920050041007621 125340052000131
125340061007511 250000072007741 200000082007842 1
50000091005031
For example Q3. enter sex of R Variable
sex location column 9 width
1 Variable sex 1 female 2 male
26(No Transcript)
27Aggregating Microdata
Zip Name Sex Major income church 29002 Wilma
F lit 0 y 99005 Barney M engin
10 n 99005 Betty F . 0 n 92005
Ethel F theater 1000 y 12534 Fred M. M PE
10000 y 12534 Lucy F lit 700
y 25000 Ricky M music 11000 y 20000 Fred A.
M dance 10500 n 15000 Ginger F math 9500
y
28Aggregating Microdata
Zip Name Sex Major income church 2 Wilma
F lit 0 y 9 Barney M engin
10 n 9 Betty F . 0 n 9
Ethel F theater 1000 y 1 Fred M. M PE
10000 y 1 Lucy F lit 700 y 2
Ricky M music 11000 y 2 Fred A. M
dance 10500 n 1 Ginger F math 9500
y
29Aggregating Microdata
Zip Name Sex Major income church 1 Fred
M. M PE 10000 y 1 Ginger F math
9500 y 1 Lucy F lit 700 y 2
Fred A. M dance 10500 n 2 Ricky M
music 11000 y 2 Wilma F lit 0
y 9 Barney M engin 10 n 9 Betty
F . 0 n 9 Ethel F theater 1000
y
30Aggregating Microdata
Zip Sex 1
M 1 F 1 F 2
M 2 M 2 F 9
M 9 F 9 F
31Aggregating Microdata
Zip Sex Male Female 1
M 1 2 1 F 1 F 2
M 2 1 2 M 2
F 9 M 1 2 9 F 9
F
32Aggregating Microdata
Geo Sex Male Female 1
1 2 2
2 1 9 1
2
33Aggregating Microdata
Geo Sex Male Female 1
1 2 2 2
1 9 1 2
34Aggregate Data
35(No Transcript)