Halvor,
I have experienced this behaviour too.
The problem comes from the fact that EpiData export to Stata (8) sets display format of the variable (in Stata) equal to the variable length in EpiData. This means that you have to manually change display formats in Stata, if your are using value labels on your data.
I do not know if this behaviour is expected (we would have to ask Jens Lauritsen about that?), or if it's a bug.
The following (Stata example) should illustrate the problem (using one of my own datasets). The variables are defined as # in EpiData:
-------------------------------------
. use odont1 (Data file created by EpiData based on odont1.rec)
. de sex*
storage display value variable name type format label variable label ------------------------------------------------------------------------------- sexanthr byte %1.0f SEXFMT 0-3 Sex due to anthropological analysis sexarch byte %1.0f SEXFMT 0-4 Sex due to archaeological analysis
. list sex*
+--------------------+ | sexanthr sexarch | |--------------------| 1. | ( F | 2. | ( m | 3. | ( m | 4. | ( ( | +--------------------+
. list sex* , nolabel
+--------------------+ | sexanthr sexarch | |--------------------| 1. | 2 1 | 2. | 2 3 | 3. | 2 3 | 4. | 4 4 | +--------------------+
. format sex* %28.0f
. de sex*
storage display value variable name type format label variable label ------------------------------------------------------------------------------- sexanthr byte %28.0f SEXFMT 0-3 Sex due to anthropological analysis sexarch byte %28.0f SEXFMT 0-4 Sex due to archaeological analysis
. list sex*
+---------------------------------------------------------+ | sexanthr sexarch | |---------------------------------------------------------| 1. | (female) [= probably female] Female | 2. | (female) [= probably female] male | 3. | (female) [= probably female] male | 4. | (male) [= probably male] (male) [= probably male] | +---------------------------------------------------------+
-------------------------------------
That is: nothing is missing in Stata, but it is discarded in display, because of display format. Try -list, nolabel- and the actual values will be displayed.
See -help format- on how to change display formats of variables.
/Jesper
Regards,
Jesper Kjær Hansen Student Assistant Department of Statistics University of Southern Denmark mailto:kjaer.hansen@oncable.dk
*---------------------------------------------* | Call me with Skype: callto://kjaer.hansen | | or find me on MSN Messenger | *---------------------------------------------*
Halvor Sommerfelt wrote:
Subject: [EpiData-list] Problems with variable labels after transferring data from Epidata to Stata
Hi:
I'm a newcomer to Epidata and am holding a course on Data entry and analysis for our Masters students this week. I have a problem in that variable labels that seem to work well in Epidata 3.02 are not maintained properly after exporting the data to Stata. It works fine when exporting to SPSS.
The pictures under http://www.cih.uib.no/presentations/hsommerfelt/EpidataLabels.JPG illustrate the problem.
I would greatly appreciate advice on how to solve the problem.
Yours sincerely
Professor Halvor Sommerfelt, MD, PhD, DTM, Centre for International Health, University of Bergen, Armauer Hansen Building, N-5021 Bergen, Norway Ph: +47 5597 4987 Fax: +47 5597 4979
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list