[EpiData-list] Value label export to Stata

EpiData development and support epidata-list at lists.umanitoba.ca
Fri Jul 31 02:58:14 CDT 2015


The lacking value label feature in Stata for string variables is a feature of Stata not of EpiData.

In that case I would analyze the data with such variables in EpiData Analysis.

or alternatively during entry have the EntryClient copy the value label for a given string variable to a separate long string variable, which must be defined before you can indicate so in Manager. That second variable should then be marked "no-enter".

If you follow that you can in Stata upon import of the data create a numerical variable with the command:
* say your variable is mkode, then:
tab mkode , gen(mkodevalue)
* would generate an indicator variable (0/1) for each of the string values in mkode
* names would be mkodevalue1 mkodevalue2 ......etc

* whereas:
encode mkode, generate(mkodes)
* would generate a new integer variable where each string value would be a value label entry in Stata
e.g.:
. label list
mkodes:
1 A
2 A0
3 A00

Regards
Jens Lauritsen

Den 31. jul. 2015, EpiData development and support <epidata-list at lists.umanitoba.ca> skrev:
> I think that is the big problem, Stats not allowing to import value labels for string variables. I don't see the logic of that, I think it should be elementary.
> 
> Is there any way around that? We have many string variables with long list of value labels attached to them.
> 
> Pekka
> 
> ----- Alkuperäinen viesti -----
> Lähettäjä: "EpiData development and support" <<epidata-list at lists.umanitoba.ca>>
> Lähetetty: ‎31/‎07/‎2015 08:07
> Vastaanottaja: "EpiData development and support" <<epidata-list at lists.umanitoba.ca>>
> Aihe: Re: [EpiData-list] Value label export to Stata
> 
> Strange - I just exported to two different versions of Stata and value labels are included for integer variables. Stata does not allow value labels for string variables.
> 
> Can you try to export without the string variables in the export ?
> 
> Alternatively send a copy of the file to us on info <at> epidata.dk (disregard the "no answer return mail). We will then look at it on monday.
> 
> regards
> Jens Lauritsen
> EpiData Association
> 
> Using (help menu: copy version info):
> EpiData Manager
> Program Version: 2.0.5.51 r1184
> Core version: 2.0.0.0 r1178
> FPC Version: 2.6.4
> Platform: i386-Win32
> 
> 
> Den 31. jul. 2015, EpiData development and support <<epidata-list at lists.umanitoba.ca>> skrev:
> > Yes, I had selected ver 12 in the options, I also tried a earlier versions,
> > no luck. With string variables, stata shows value labels as "grey" and with
> > integer variables, the value label list is blank....
> > 
> > Using windows, but have also tried linux (ubuntu) but no luck.
> > 
> > 
> > Pekka
> > 
> > 2015-07-30 23:19 GMT+01:00 EpiData development and support <
> > <<epidata-list at lists.umanitoba.ca>>>:
> > 
> > > Please try to export to Stata again and indicate version 12in options
> > > (instead of v13) or earlier and report if this works. Which operating
> > > system are you using ?
> > > regards Jens Lauritsen
> > > EpiData Association
> > > 
> > > 
> > > On 30/07/15 23:41, EpiData development and support wrote:
> > > 
> > > > Hello,
> > > > 
> > > > When exporting to Stata (ver13), value labels don't seem to follow the
> > > > data. We are using Epidata Manager 2.0.5.51 and first I thought it was due
> > > > to value labels being external rather than internal, but then I tried with
> > > > a dataset with internal value labels, but the result was just the same, no
> > > > value labels visible in Stata.
> > > > 
> > > > Help much appreciated!
> > > > 
> > > > Pekka Isosomppi
> > > > _______________________________________________
> > > > EpiData-list mailing list
> > > > EpiData-list at lists.umanitoba.ca
> > > > <<http://lists.umanitoba.ca/mailman/listinfo/epidata-list>>
> > > > 
> > > > 
> > > > _______________________________________________
> > > > EpiData-list mailing list
> > > EpiData-list at lists.umanitoba.ca
> > > <<http://lists.umanitoba.ca/mailman/listinfo/epidata-list>>
> > > 
> > > _______________________________________________
> > > EpiData-list mailing list
> > EpiData-list at lists.umanitoba.ca
> > <<http://lists.umanitoba.ca/mailman/listinfo/epidata-list>>
> > 
> > _______________________________________________
> EpiData-list mailing list
> EpiData-list at lists.umanitoba.ca
> <http://lists.umanitoba.ca/mailman/listinfo/epidata-list>
> _______________________________________________
> EpiData-list mailing list
> EpiData-list at lists.umanitoba.ca
> <http://lists.umanitoba.ca/mailman/listinfo/epidata-list>
> 


More information about the EpiData-list mailing list