forked from labordynamicsinstitute/test-part-1-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_dataclean.log
407 lines (382 loc) · 20.2 KB
/
01_dataclean.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
___ ____ ____ ____ ____ (R)
/__ / ____/ / ____/
___/ / /___/ / /___/ 16.1 Copyright 1985-2019 StataCorp LLC
Statistics/Data analysis StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC https://www.stata.com
979-696-4600 [email protected]
979-696-4601 (fax)
Stata license: 5-user network perpetual
Serial number: 501606316764
Licensed to: LDI Econ Cornell University
Ithaca, NY
Notes:
1. Stata is running in batch mode.
2. Unicode is supported; see help unicode_advice.
. do programs/01_dataclean.do
. /* $Id: 01_stata.do 1259 2014-12-10 14:37:31Z lv39 $ */
. /* This file reads in Alaska PUMS data */
. /* SRC: http://doi.org/10.3886/ICPSR13568.v1 */
. /* Source program: "ICPSR_13568/13568-Setup.do" was used
> as a template, */
. /* Author: Lars Vilhuber */
.
.
. clear
. infile using "/home/vilhuber/Workspace/git/LDI/test-part-1-2/programs/housi
> ng.dct" if rectype=="H", using ("/ramdisk/ICPSR_13568/DS0002/13568-0002-Data.
> txt")
dictionary {
str1 rectype %1s "Record Type"
_column(2) str7 serialno %7s "Housing/Group Quarters (GQ) Unit Serial Number"
_column(9) str1 sample %1s "Sample Identifier"
_column(10) str2 state %2s "State (FIPS)"
_column(12) str1 region %1s "Region"
_column(13) str1 division %1s "Division"
_column(14) str5 puma5 %5s "Public Use Microdata Area Code (PUMA)"
_column(19) str5 puma1 %5s "Super Public Use Microdata Area Code (SuperPUMA)"
_column(24) str4 msacmsa5 %4s "Metropolitan Area (MA):MSA/CMSA for PUMA"
_column(28) str4 msapmsa5 %4s "Metropolitan Area:MSA/PMSA for PUMA"
_column(32) str4 msacmsa1 %4s "Metropolitan Area:MSA/CMSA for SuperPUMA"
_column(36) str4 msapmsa1 %4s "Metropolitan Area:MSA/PMSA for SuperPUMA"
_column(40) str2 areatyp5 %2s "Metropolitan Area:PUMA Relationship to MA"
_column(42) str2 areatyp1 %2s "Metropolitan Area:SuperPUMA Relationship to MA
> "
_column(44) str14 totpuma5 %14s "Total Area of PUMA"
_column(58) str14 lndpuma5 %14s "Land Area of PUMA"
_column(72) str14 totpuma1 %14s "Total Area of SuperPUMA"
_column(86) str14 lndpuma1 %14s "Land Area of SuperPUMA"
_column(100) str2 subsampl %2s "Subsample Number"
_column(102) int hweight %4f "Housing Unit Weight"
_column(106) int persons %2f "Number of Person Records Following This Housing R
> ecord"
_column(108) str1 unittype %1s "Type of Unit"
_column(109) str1 hsub %1s "Substitution Flag"
_column(110) str1 haug %1s "Augmentation Flag"
_column(111) str1 vacstat %1s "Vacancy Status"
_column(112) str1 vacstata %1s "Vacancy Status Allocation Flag"
_column(113) str1 tenure %1s "Home Ownership"
_column(114) str1 tenurea %1s "Home Ownership Allocation Flag"
_column(115) str2 bldgsz %2s "Size of Building"
_column(117) str1 bldgsza %1s "Size of Building Allocation Flag"
_column(118) str1 yrbuilt %1s "Year Building Built"
_column(119) str1 yrbuilta %1s "Year Building Built Allocation Flag"
_column(120) str1 yrmoved %1s "Year Moved In"
_column(121) str1 yrmoveda %1s "Year Moved In Allocation Flag"
_column(122) str1 rooms %1s "Number of Rooms"
_column(123) str1 roomsa %1s "Number of Rooms Allocation Flag"
_column(124) str1 bedrms %1s "Number of Bedrooms"
_column(125) str1 bedrmsa %1s "Number of Bedrooms Allocation Flag"
_column(126) str1 cplumb %1s "Complete Plumbing Facilities"
_column(127) str1 cplumba %1s "Complete Plumbing Facilities Allocation Flag"
_column(128) str1 ckitch %1s "Complete Kitchen Facilities"
_column(129) str1 ckitcha %1s "Complete Kitchen Facilities Allocation Flag"
_column(130) str1 phone %1s "Telephone Availability"
_column(131) str1 phonea %1s "Telephone Availability Allocation Flag"
_column(132) str1 fuel %1s "Heating Fuel"
_column(133) str1 fuela %1s "Heating Fuel Allocation Flag"
_column(134) str1 vehicl %1s "Number of Vehicles Available"
_column(135) str1 vehicla %1s "Number of Vehicles Available Allocation Flag"
_column(136) str1 busines %1s "Commercial Business on Property"
_column(137) str1 businesa %1s "Commercial Business on Property Allocation Flag
> "
_column(138) str1 acres %1s "Acreage"
_column(139) str1 acresa%1s "Acreage Allocation Flag"
_column(140) str1 agsales %1s "Sales of Agricultural Products in 1999"
_column(141) str1 agsalesa %1s "Sales of Agricultural Products in 1999 Allocati
> on Flag"
_column(142) str4 elec %4s "Cost of Electricity (annual)"
_column(146) str1 eleca %1s "Cost of Electricity (annual) Allocation Flag"
_column(147) str4 gas %4s "Cost of Gas (annual)"
_column(151) str1 gasa %1s "Cost of Gas (annual) Allocation Flag"
_column(152) str4 water %4s "Cost of Water and Sewage (annual)"
_column(156) str1 watera %1s "Cost of Water and Sewage (annual) Allocation Flag
> "
_column(157) str4 oil %4s "Cost of Oil, Kerosene, or Wood (annual)"
_column(161) str1 oila %1s "Cost of Oil, Kerosene, or Wood (annual) Allocation
> Flag"
_column(162) str4 rent %4s "Monthly Rent"
_column(166) str1 renta %1s "Monthly Rent Allocation Flag"
_column(167) str1 meals %1s "Meals Included in Rent"
_column(168) str1 mealsa %1s "Meals Included in Rent Allocation Flag"
_column(169) str1 mortg1 %1s "Mortgage Status"
_column(170) str1 mortg1a %1s "Mortgage Status Allocation Flag"
_column(171) str5 mrt1amt %5s "Mortgage Payment (monthly amount)"
_column(176) str1 mrt1amta %1s "Mortgage Payment (monthly amount) Allocation Fl
> ag"
_column(177) str1 mortg2 %1s "Second Mortgage Status"
_column(178) str1 mortg2a %1s "Second Mortgage Status Allocation Flag"
_column(179) str5 mrt2amt %5s "Second Mortgage Payment (monthly amount)"
_column(184) str1 mrt2amta %1s "Second Mortgage Payment (monthly amount) Alloca
> tion Flag"
_column(185) str1 taxincl %1s "Property Tax Status"
_column(186) str1 taxincla %1s "Property Tax Status Allocation Flag"
_column(187) str2 taxamt %2s "Property Tax Amount (annual)"
_column(189) str1 taxamta %1s "Property Tax Amount (annual) Allocation Flag"
_column(190) str1 insincl %1s "Property Insurance Status"
_column(191) str1 insincla %1s "Property Insurance Status Allocation Flag"
_column(192) str4 insamt %4s "Property Insurance Amount (annual)"
_column(196) str1 insamta %1s "Property Insurance Amount (annual) Allocation Fl
> ag"
_column(197) str4 condfee %4s "Condominium Fee (monthly)"
_column(201) str1 condfeea %1s "Condominium Fee (monthly) Allocation Flag"
_column(202) str2 value %2s "Property Value"
_column(204) str1 valuea %1s "Property Value Allocation Flag"
_column(205) str1 mhloan %1s "Mobile Home Loan Status"
_column(206) str1 mhloana %1s "Mobile Home Loan Status Allocation Flag"
_column(207) str5 mhcost %5s "Mobile Home Costs"
_column(212) str1 mhcosta %1s "Mobile Home Costs Allocation Flag"
_column(213) str1 hht %1s "Household/Family Type"
_column(214) str2 p65 %2s "Number of People 65 years and over"
_column(216) str2 p18 %2s "Number of People under 18 years"
_column(218) str2 npf %2s "Number of People in Family"
_column(220) str2 noc %2s "Number of Own Children Under 18 Years in Household"
_column(222) str2 nrc %2s "Number of Related Children Under 18 Years in Househo
> ld"
_column(224) str1 psf %1s "Presence of Subfamily in Household"
_column(225) str1 paoc %1s "Presence and Age of Own Children Under 18 Years"
_column(226) str1 parc %1s "Presence and Age of Related Children Under Years"
_column(227) str1 sval %1s "Specified Value Indicator"
_column(228) str5 smoc %5s "Selected Monthly Owner Costs"
_column(233) str3 smocapi %3s "Selected Mnthly Ownr Costs as a Percntge of Hseh
> ld Inc"
_column(236) str1 srnt %1s "Specified Rent Indicator"
_column(237) str4 grent %4s "Gross Rent"
_column(241) str3 grapi %3s "Gross Rent as a Percentage of Household Income"
_column(244) str1 fnf %1s "Fam/Nonfam Recode"
_column(245) str1 hhl %1s "Household Language"
_column(246) str1 lngi %1s "Linguistic Isolation"
_column(247) str1 wif %1s "Number of Workers in Family"
_column(248) str1 empstat %1s "Family Type and Employment Status"
_column(249) str2 workexp %2s "Family Type and Work Experience of Householder"
_column(251) str8 hinc %8s "Household Total Income in 1999"
_column(259) str8 finc %8s "Family Total Income in 1999"
}
(14,013 observations read)
. sort serialno /* sort data by Serial Number */
. saveold "/home/vilhuber/Workspace/git/LDI/test-part-1-2/data/cleaned/housin
> g.dta", version(12) /* save housing unit data */
(saving in Stata 12 format, which can be read by Stata 11 or 12)
file /home/vilhuber/Workspace/git/LDI/test-part-1-2/data/cleaned/housing.dta sa
> ved
.
. clear
. infile using "/home/vilhuber/Workspace/git/LDI/test-part-1-2/programs/perso
> n.dct" if rectype=="P", using ("/ramdisk/ICPSR_13568/DS0002/13568-0002-Data.t
> xt")
dictionary {
str1 rectype %1s "Record Type"
_column(2) str7 serialno %7s "Housing/Group Quarters (GQ) Unit Serial Number"
_column(9) str2 pnum %2s "Person Sequence Number"
_column(11) str1 paug %1s "Augmented Person Flag"
_column(12) str1 ddp %1s "Data-defined Person Flag"
_column(13) str4 pweight %4s "Person Weight"
_column(17) str2 relate %2s "Relationship"
_column(19) str1 relatea %1s "Relationship Allocation Flag"
_column(20) str1 oc %1s "Own Child Indicator"
_column(21) str1 rc %1s "Related Child Indicator"
_column(22) str1 paocf %1s "Presence and Age of Own Children, Females"
_column(23) str1 sex %1s "Sex"
_column(24) str1 sexa %1s "Sex Allocation Flag"
_column(25) str2 age %2s "Age"
_column(27) str1 agea %1s "Age Allocation Flag"
_column(28) str2 hispan %2s "Hispanic or Latino Origin"
_column(30) str1 hispana %1s "Hispanic or Lationo Origin Allocation Flag"
_column(31) str1 numrace %1s "Number of Major Race Groups Marked"
_column(32) str1 white %1s "White recode"
_column(33) str1 black %1s "Black or African American recode"
_column(34) str1 aian %1s "American Indian and Alaska Native recode"
_column(35) str1 asian %1s "Asian recode"
_column(36) str1 nhpi %1s "Native Hawaiian and Other Pacific Islanders recode"
_column(37) str1 other %1s "Some other race recode"
_column(38) str1 race1 %1s "Race Recode 1"
_column(39) str2 race2 %2s "Race Recode 2"
_column(41) str2 race3 %2s "Race Recode 3"
_column(43) str1 racea %1s "Race Allocation Flag"
_column(44) str1 marstat %1s "Marital Status"
_column(45) str1 marstata %1s "Marital Status Allocation Flag"
_column(46) str1 msp %1s "Married, Spouse Present Recode"
_column(47) str1 sfn %1s "Subfamily Number for this Person"
_column(48) str1 sfrel %1s "Subfamily Relationship"
_column(49) str1 enroll %1s "School Enrollment: Attended since February 1, 200
> 0"
_column(50) str1 enrolla %1s "School Enrollment: Attended since February 1, 20
> 00 Allocation Flag"
_column(51) str1 grade %1s "School Enrollment: Grade Level Attending"
_column(52) str1 gradea %1s "School Enrollment: Grade Level Attending Allocati
> on Flag"
_column(53) str2 educ %2s "Educational Attainment"
_column(55) str1 educa %1s "Educational Attainment Allocation Flag"
_column(56) str3 ancfrst %3s "Ancestry Code, First"
_column(59) str3 ancscnd %3s "Ancestry Code, Second"
_column(62) str1 anca %1s "Ancestry Allocation Flag"
_column(63) str1 ancr %1s "Ancestry Recode"
_column(64) str1 speak %1s "Non-English Language"
_column(65) str1 speaka %1s "Non-English Language Allocation Flag"
_column(66) str3 lang %3s "Language Spoken"
_column(69) str1 langa %1s "Language Spoken Allocation Flag"
_column(70) str1 engabil %1s "English Ability"
_column(71) str1 engabila %1s "English Ability Allocation Flag"
_column(72) str3 pob %3s "Place of Birth"
_column(75) str1 poba %1s "Place of Birth Allocation Flag"
_column(76) str1 citizen %1s "Citizenship Status"
_column(77) str1 citizena %1s "Citizenship Status Allocation Flag"
_column(78) str4 yr2us %4s "Year of Entry to United States"
_column(82) str1 yr2usa %1s "Year of Entry to United States Allocation Flag"
_column(83) str1 mob %1s "Residence 5 Years Ago"
_column(84) str1 moba %1s "Residence 5 Years Ago Allocation Flag"
_column(85) str3 migst %3s "Migration State or Foreign Country Code"
_column(88) str1 migsta %1s "Migration State or Foreign Country Allocation Fla
> g"
_column(89) str5 migpuma5 %5s "Migration PUMA"
_column(94) str5 migpuma1 %5s "Migration Super-PUMA"
_column(99) str2 migarea5 %2s "Migration PUMA Relationship to MA"
_column(101) str2 migarea1 %2s "Migration Super-PUMA Relationship to MA"
_column(103) str4 migcma5 %4s "Migration MA:MSA/CMSA for Migration PUMA"
_column(107) str4 migcma1 %4s "Migration MA:MSA/CMSA for Migration Super-PUMA"
_column(111) str4 migpma5 %4s "Migration MA:MSA/PMSA for Migration PUMA"
_column(115) str4 migpma1 %4s "Migration MA:MSA/PMSA For Migration Super-PUMA"
_column(119) str1 sensory %1s "Sensory Disability"
_column(120) str1 sensorya %1s "Sensory Disability Allocation Flag"
_column(121) str1 physcl %1s "Physical Disability"
_column(122) str1 physcla %1s "Physical Disability Allocation Flag"
_column(123) str1 mental %1s "Mental Disability"
_column(124) str1 mentala %1s "Mental Disability Allocation Flag"
_column(125) str1 slfcare %1s "Self-Care Disability"
_column(126) str1 slfcarea %1s "Self-Care Disability Allocation Flag"
_column(127) str1 abgo %1s "Able to Go Out Disability"
_column(128) str1 abgoa %1s "Able to Go Out Disability Allocation Flag"
_column(129) str1 abwork %1s "Employment Disability"
_column(130) str1 abworka %1s "Employment Disability Allocation Flag"
_column(131) str1 disable %1s "Disability Recode"
_column(132) str1 grandc %1s "Presence of Grandchildren under 18 years"
_column(133) str1 grandca %1s "Presence of Grandchildren under 18 years Allocat
> ion Flag"
_column(134) str1 rspnsbl %1s "Responsible for Grandchildren"
_column(135) str1 rspnsbla %1s "Responsible for Grandchildren Allocation Flag"
_column(136) str1 howlong %1s "Length of Responsibility for Grandchildren"
_column(137) str1 howlonga %1s "Length of Responsibility for Grandchildren Allo
> cation Flag"
_column(138) str1 miltary %1s "Military Service"
_column(139) str1 miltarya %1s "Military Service Allocation Flag"
_column(140) str1 vps1 %1s "On active duty April 1995 or later"
_column(141) str1 vps2 %1s "On active duty August 1990-March 1995 (Incl. Persia
> n Gulf War)"
_column(142) str1 vps3 %1s "On active duty September 1980-July 1990"
_column(143) str1 vps4 %1s "On active duty May 1975-August 1980"
_column(144) str1 vps5 %1s "On active duty during Vietnam Era: August 1964-Apri
> l 1975"
_column(145) str1 vps6 %1s "On active duty February 1955-July 1964"
_column(146) str1 vps7 %1s "On active duty during Korean War: June 1950-January
> 1955"
_column(147) str1 vps8 %1s "On active duty during World War II: September 1940-
> July 1947"
_column(148) str1 vps9 %1s "On active duty any other time"
_column(149) str1 vpsa %1s "Veterans Period of Service Alloction Flag"
_column(150) str1 milyrs %1s "Years of Military Service"
_column(151) str1 milyrsa %1s "Years of Military Service Allocation Flag"
_column(152) str2 vpsr %2s "Veterans Period of Service Recode"
_column(154) str1 esr %1s "Employment Status Recode"
_column(155) str1 esra %1s "Employment Status Allocation Flag"
_column(156) str1 esp %1s "Employment Status of Parent(s)"
_column(157) str3 powst %3s "Place of Work State or Foreign Country Code"
_column(160) str1 powsta %1s "Place of Work State or Foreign Country Code Alloc
> ation Flag"
_column(161) str5 powpuma5 %5s "Place of Work"
_column(166) str5 powpuma1 %5s "Place of Work Super-PUMA"
_column(171) str2 powarea5 %2s "Place of Work PUMA Relationship to MA"
_column(173) str2 powarea1 %2s "Place of Work Super-PUMA Relationship to MA"
_column(175) str4 powcma5 %4s "Place of Work MA:MSA/CMSA for Place of Work PUMA
> "
_column(179) str4 powcma1 %4s "Place of Work MA:MSA/CMSA for Place of Work Supe
> r-PUMA"
_column(183) str4 powpma5 %4s "Place of Work MA:MSA/PMSA for Place of Work PUMA
> PUMS"
_column(187) str4 powpma1 %4s "Place of Work MA: MSA/PMSA for Place of Work Sup
> er-PUMA"
_column(191) str2 trvmns %2s "Means of Transportation to Work"
_column(193) str1 trvmnsa %1s "Means of Transportation to Work Allocation Flag"
_column(194) str1 carpool %1s "Vehicle Occupancy"
_column(195) str1 carpoola %1s "Vehicle Occupancy Allocation Flag"
_column(196) str3 lvtime %3s "Time Leaving for Work"
_column(199) str1 lvtimea %1s "Time Leaving for Work Allocation Flag"
_column(200) str3 trvtime %3s "Travel Time to Work"
_column(203) str1 trvtimea %1s "Travel Time to Work Allocation Flag"
_column(204) str1 layoff %1s "Layoff from Job"
_column(205) str1 absent %1s "Absent from Work"
_column(206) str1 recall %1s "Return-to-Work Recall"
_column(207) str1 lookwrk %1s "Looking for Work"
_column(208) str1 backwrk %1s "Back to Work"
_column(209) str1 lastwrk %1s "Year Last Worked"
_column(210) str1 lastwrka %1s "Year Last Worked Allocation Flag"
_column(211) str3 indcen %3s "Industry (Census)"
_column(214) str1 indcena %1s "Industry (Census) Allocation Flag"
_column(215) str8 indnaics %8s "Industry (NAICS)"
_column(223) str3 occcen %3s "Occupation (Census)"
_column(226) str1 occcena %1s "Occupation (Census) Allocation Flag"
_column(227) str7 occsoc %7s "Occupation (SOC)"
_column(234) str1 clwkr %1s "Class of Worker"
_column(235) str1 clwkra %1s "Class of Worker Allocation Flag"
_column(236) str1 wrklyr %1s "Worked in 1999"
_column(237) str1 wrklyra %1s "Worked in 1999 Allocation Flag"
_column(238) str2 weeks %2s "Weeks Worked in 1999"
_column(240) str1 weeksa %1s "Weeks Worked in 1999 Allocation Flag"
_column(241) str2 hours %2s "Hours Per Week Worked in 1999"
_column(243) str1 hoursa %1s "Hours Per Week Worked in 1999 Allocation Flag"
_column(244) str6 incws %6s "Wage/Salary Income in 1999"
_column(250) str1 incwsa %1s "Wage/Salary Income in 1999 Allocation Flag"
_column(251) str6 incse %6s "Self-Employment Income in 1999"
_column(257) str1 incsea %1s "Self-Employment Income in 1999 Allocation Flag"
_column(258) str6 incint %6s "Interest Income in 1999"
_column(264) str1 incinta %1s "Interest Income in 1999 Allocation Flag"
_column(265) str5 incss %5s "Social Security Income in 1999"
_column(270) str1 incssa %1s "Social Security Income in 1999 Allocation Flag"
_column(271) str5 incssi %5s "Supplemental Security Income in 1999"
_column(276) str1 incssia %1s "Supplemental Security Income in 1999 Allocation
> Flag"
_column(277) str5 incpa %5s "Public Assistance Income in 1999"
_column(282) str1 incpaa %1s "Public Assistance Income in 1999 Allocation Flag"
_column(283) str6 incret %6s "Retirement Income in 1999"
_column(289) str1 increta %1s "Retirement Income in 1999 Allocation Flag"
_column(290) str6 incoth %6s "Other Income in 1999"
_column(296) str1 incotha %1s "Other Income in 1999 Allocation Flag"
_column(297) str7 inctot %7s "Persons Total Income in 1999"
_column(304) str1 inctota %1s "Persons Total Income in 1999 Allocation Flag"
_column(305) str7 earns %7s "Persons Total Earnings in 1999"
_column(312) str3 poverty %3s "Persons Poverty Status"
}
(31,924 observations read)
. sort serialno /* sort data by Serial Number */
. saveold "/home/vilhuber/Workspace/git/LDI/test-part-1-2/data/cleaned/person
> .dta", version(12) /* save person data */
(saving in Stata 12 format, which can be read by Stata 11 or 12)
file /home/vilhuber/Workspace/git/LDI/test-part-1-2/data/cleaned/person.dta sav
> ed
.
. merge serialno using "/home/vilhuber/Workspace/git/LDI/test-part-1-2/data/c
> leaned/housing.dta" /* merge person and housing unit data */
(note: you are using old merge syntax; see [D] merge for new syntax)
variable serialno does not uniquely identify observations in the master data
. drop _merge
. /* keep only relevant information */
. keep pweight race2 race1 numrace
. /* code a dummy to the four tribes */
. gen specific_ak=(race2 == "31" | race2 == "32" | race2 == "33" | race2 == "
> 34")
. /* convert weights */
. destring pweight, gen(pweight_num)
pweight: all characters numeric; pweight_num generated as int
(1969 missing values generated)
. /* label variables */
. label variable specific_ak "Identifying with one of the four tribes"
. label variable pweight_num "Person weight"
. saveold "/home/vilhuber/Workspace/git/LDI/test-part-1-2/data/cleaned/merged
> .dta" , version(12) /* save merged data */
(saving in Stata 12 format, which can be read by Stata 11 or 12)
file /home/vilhuber/Workspace/git/LDI/test-part-1-2/data/cleaned/merged.dta sav
> ed
.
.
.
end of do-file