Export to Stata - not merging person & housing records

Discussions about tools to complement CSPro data processing
Forum rules
New release: CSPro 8.0
Post Reply
osmcdoom
Posts: 4
Joined: July 6th, 2014, 1:43 pm

Export to Stata - not merging person & housing records

Post by osmcdoom »

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
}
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Export to Stata - not merging person & housing records

Post by Gregory Martin »

Can you upload your dictionary file as an attachment? If so, I can run the export (on data that I'll create) and see what happens for me.
osmcdoom
Posts: 4
Joined: July 6th, 2014, 1:43 pm

Re: Export to Stata - not merging person & housing records

Post by osmcdoom »

I attempted to upload the dictionary file but receive the error message that 'The extension dcf is not allowed'
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Export to Stata - not merging person & housing records

Post by Gregory Martin »

You can zip up the dictionary file and then upload that zipped file. Thanks.
Aliraza84
Posts: 1
Joined: December 14th, 2014, 11:45 pm

Re: Export to Stata - not merging person & housing records

Post by Aliraza84 »

The problem we had when designing for the Unicode version is that CSPro uses simple text files as our data files, so we don't have any useful way of storing metadata about the file. For example, if we used a binary format, we could have a flag that indicated if the data was ANSI or UTF-8, but we don't have that.

So we had to figure out a way to identify between data files created in older versions of CSPro and data created in the newer version. The answer was adding the BOM to the data files. For example, if we didn't have it, and we encountered a character like 'ü' in the data file, we wouldn't necessarily know if it was a German accented letter, or if it was the beginning of a UTF-8 character sequence. The BOM helps us interpret all characters correctly.
Decrease your exam stress by using our latest green belt six sigma and best quality istqb test and Testking We provide with 100% pass guarantee along with www.pittstate.edu
Post Reply