Export To Stata: 2+ Multiple-Occurence Records

Discussions about tools to complement CSPro data processing
Post Reply
slwendo
Posts: 17
Joined: March 11th, 2017, 4:13 pm

Export To Stata: 2+ Multiple-Occurence Records

Post by slwendo »

Hi,

I've tried exporting data from csdb to STATA (CSPro 7.7) where my dictionary more than 1 records that have a max occurence >1. The output Stata file is always missing one of the multi-occuring records. What could be the problem?

Dictioanry structure:

MYDICTIONARY
- ID
- HH_REC [Max Occ = 1]
- POP_REC [Max Occ = 100]
- MORT_REC [Max Occ = 20]
- ROS_REC [Max Occ = 100]
- META_REC [Max Occ = 1]
- HH_DETAILS [Max Occ = 1]
- IND_DETAILS [Max Occ = 1]

When I export using the Export tool (from Data Viewer), One of POP_REC, MORT_REC, ROS_REC is always missing.

The specifics on my export are
Number of Files Created: One File
Output of Multiple Record Occurences: As Seperated Records and Join Single with Multiple Records
Export Format: Stata (.dat, .dct, .do)
Export Record Type: Before ID Items
Export Items or Subitems: Items Only
Additional Options: None
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Export To Stata: 2+ Multiple-Occurence Records

Post by Gregory Martin »

Exporting data from cases where multiple records contain multiple occurrences is always tricky. Your best options are:

1) Change the Output... to "All in One Record."

2) Keep "As Separate Records" but run multiple exports, one for each repeating record, and then combine the data in Stata.

Essentially the problem is that the text-based export to Stata doesn't properly support using multiple lines of data to represent different multiply-occurring records.

You might also consider using a batch application to write your data to the Stata data source: https://www.csprousers.org/help/CSPro/d ... stata.html
Post Reply