[EpiData-list] Missing data values when exporting to Stata (EpiData development and support)

EpiData development and support epidata-list at lists.umanitoba.ca
Tue Aug 27 13:00:59 CDT 2019


Dear Henning:

If the ultimate objective is to use the data set in R, then I used this 
most simple approach (provided you have a *.REC/*.CHK pair, I forgot if 
you started from *.epx):

1) Go to EpiData Entry 3.1, and export to Stata *.dta

2a) In R, if you want labels rather than values use:
library(foreign)
myrset_0.rda <- read.dta("c:/your_ path/..../myfile.dta")

2b) In R, if you want values rather than labels use:
library(foreign)
myrset_0.rda <- read.epiinfo("c:/your_ path/..../myfile.rec")

Though, apologies:
- I haven't considered it for *.epx files, but then it's also simple:

Go to EpiData Analysis V2.2.3.187 and write
close
read "myepxfile.epx"
savedata "myepxfile.rec" /replace

Now the real issue might be your coding of the missing, but then if that 
is the problem, it's an easy thing to just recode it in EpiData Analysis 
to a uniform (or two) value(s) for your missing and save.

Regards,

Hans

On 27-Aug-19 15:18, EpiData development and support wrote:
> Hi,
>
> Exporting the .dta file from Analysis throws the same error in Python as the Stata 14-file from EpiData Manager. Unsure if this is a Python error or Stata-export error. I have used all versions earlier in R so probably something to do with Python Pandas read_stata-function.
>
> Kind Regards
> Henning
>

-- 
Hans L Rieder, MD, MPH
Jetzikofenstr 12
3038 Kirchlindach
   Switzerland

Tel: +41 31 829 4577
Mob: +41 79 321 9122
Skype: hansleonhardrieder
Web: http://www.tbrieder.org



More information about the EpiData-list mailing list