[EpiData-list] Missing data values when exporting to Stata

EpiData development and support epidata-list at lists.umanitoba.ca
Wed Aug 21 14:43:41 CDT 2019

As I remember the Stata value should be
But please specify which version of Stata and if you are using Manager export or the new analysis, which may directly save the file in Stata format.

Best wishes
Jens Lauritsen
EpiData Association

Den 21. august 2019 14.04.31 CEST, EpiData development and support <epidata-list at lists.umanitoba.ca> skrev:
>I have some missing data that is encoded as ‘9’ in the database and in
>the value label list it is flagged as missing. When exporting to CSV
>the value is obviously set as ‘9’ as expected. 
>When I export it as Stata I assume this value ‘9’ gets encoded to
>Stata’ definition of a missing value, but when I read the data in
>Python with the ‘pd.read_stata’-function it defines the category value
>‘9’ as 100.0 and not as missing data (NaN) like the blanks in EpiData.
>One column has 80 values. 19 of these are encoded as ‘9’ (missing), 58
>of these are blank, and 3 are coded as ‘1’ (Yes) in EpiData. After
>exporting to Stata and reading in Python I get 
>19 values in category ‘100’
>3 values in category ‘Yes’
>58 values NaN (i.e. missing)
>Why aren’t the ‘9’ category correctly coded as missing when exporting
>to Stata, or am I missing something here?
>Kind Regards
>EpiData-list mailing list
>EpiData-list at lists.umanitoba.ca

Sent from my Android device with K-9 Mail. Please excuse my brevity.

More information about the EpiData-list mailing list