Export to Stata - not merging person & housing records
Posted: July 31st, 2014, 12:27 am
Dear forum users,
Has anyone experienced and solved the following problem? When exporting census data to Stata, the person and housing records do not merge and appear as a separate rows in the Stata data file.
I've tried CSPro 4.1 and 5.03 and with the export function I select 'one file, as separate records, join single with multiple records, do not export record type, and export items and subitems.
I notice that the dictionary file created for Stata by CSPro's export tool lists '2 lines': one for the person and one for the housing record.
I should say that the raw census data were in IMPS format and I converted the dictionary to CSPro, concatenated all the Public Use Files into a single master file, and then ran the Export tool.
Does anyone have any suggestions? I reproduce the dictionary syntax below:
infix dictionary using "C:\Users\Mwalimu\Dropbox\Philippines\Census data\CPH2000Mindanao - download\CPH2000Mindanao.puf\Exported.dat" {
2 lines
byte regn 1: 1-2
byte province 1: 3-4
int prrcd 1: 5-7
byte mun 1: 8-9
int bgy 1: 10-12
long hhqsn 1: 13-17
byte r1hh_size 1: 18-19
byte r1p1 1: 20-21
byte p2h_relhead 1: 22-23
byte p5_reg_lcr 1: 24-24
int p6_age_last 1: 25-27
byte p7_sex 1: 28-28
byte p8h_overseas 1: 29-29
byte p9_mstatus 1: 30-30
byte p10_religion 1: 31-32
byte p13_disability 1: 33-33
byte p14_distype 1: 34-35
int p15_ethnicity 1: 36-38
byte p22_education 1: 39-40
int p23h_res_5yr_ago 1: 41-44
int r1year 1: 45-48
byte r1month 1: 49-50
byte r2hh_size 2: 18-19
byte fhsnhusn 2: 20-20
byte b1_building_type 2: 21-21
byte b2_roof 2: 22-22
byte b3_walls 2: 23-24
byte b4_repair 2: 25-25
byte b5_yr_built 2: 26-27
byte d1_floor_area 2: 28-29
byte h8_lot_tenure 2: 30-30
int r2year 2: 31-34
byte r2month 2: 35-36
}
Has anyone experienced and solved the following problem? When exporting census data to Stata, the person and housing records do not merge and appear as a separate rows in the Stata data file.
I've tried CSPro 4.1 and 5.03 and with the export function I select 'one file, as separate records, join single with multiple records, do not export record type, and export items and subitems.
I notice that the dictionary file created for Stata by CSPro's export tool lists '2 lines': one for the person and one for the housing record.
I should say that the raw census data were in IMPS format and I converted the dictionary to CSPro, concatenated all the Public Use Files into a single master file, and then ran the Export tool.
Does anyone have any suggestions? I reproduce the dictionary syntax below:
infix dictionary using "C:\Users\Mwalimu\Dropbox\Philippines\Census data\CPH2000Mindanao - download\CPH2000Mindanao.puf\Exported.dat" {
2 lines
byte regn 1: 1-2
byte province 1: 3-4
int prrcd 1: 5-7
byte mun 1: 8-9
int bgy 1: 10-12
long hhqsn 1: 13-17
byte r1hh_size 1: 18-19
byte r1p1 1: 20-21
byte p2h_relhead 1: 22-23
byte p5_reg_lcr 1: 24-24
int p6_age_last 1: 25-27
byte p7_sex 1: 28-28
byte p8h_overseas 1: 29-29
byte p9_mstatus 1: 30-30
byte p10_religion 1: 31-32
byte p13_disability 1: 33-33
byte p14_distype 1: 34-35
int p15_ethnicity 1: 36-38
byte p22_education 1: 39-40
int p23h_res_5yr_ago 1: 41-44
int r1year 1: 45-48
byte r1month 1: 49-50
byte r2hh_size 2: 18-19
byte fhsnhusn 2: 20-20
byte b1_building_type 2: 21-21
byte b2_roof 2: 22-22
byte b3_walls 2: 23-24
byte b4_repair 2: 25-25
byte b5_yr_built 2: 26-27
byte d1_floor_area 2: 28-29
byte h8_lot_tenure 2: 30-30
int r2year 2: 31-34
byte r2month 2: 35-36
}