Suzanna and Jens Thank you! Now it works great. I found that i have to run the diformat command for each labeled variable to get it right. Dont know why. But a do file takes care of that. This is brilliant! lars
Den 20/01/12 00.18 skrev "epidata-list@lists.umanitoba.ca" epidata-list@lists.umanitoba.ca:
Hi Lars,
I've had the same issue when exporting value labels to Stata. When you "browse" or "list" in Stata, the number of letters displayed is limited to the length of the field. However, you should be able to see the entire label (unless it's very long) when you use the "tabulate" command.
When you use the "describe" command you'll find that the display format of your gender variable is 2 characters, e.g. %2.0f. You need to increase the length of your display format. I've written a very short ado file to do this (attached) for all variables in your data set that have a value label attached. For each variable it ascertains the length of your longest label, e.g. for gender labelled "male" and "female" it is 6. It then changes the display format so that up to 6 characters are displayed.
The syntax is: diformat var1 var2 where var1 is the first variable in the dataset and var2 is the last.
Cheers,
Suzanna Vidmar Senior Research Officer Clinical Epidemiology and Biostatistics Unit
Murdoch Childrens Research Institute Royal Children's Hospital Flemington Road Parkville Victoria 3052 Australia
telephone: +61 3 9345 6372 facsimile: +61 3 9345 6000 email: suzanna.vidmar@mcri.edu.au www.mcri.edu.au
-----Original Message----- From: epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] On Behalf Of epidata-list@lists.umanitoba.ca Sent: Friday, 20 January 2012 1:33 AM To: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] export to stata and view enteries
Thank you for The answers. How about my labels being shortaned into two letters? Any thoughts?
Mvh Lars Folkestad
Den 19/01/2012 kl. 15.16 skrev "epidata-list@lists.umanitoba.ca" epidata-list@lists.umanitoba.ca:
Explanation to Lars:
- We will implement a grid view function, such as the one shown now
in EntryClient with the find dialog
- This is an error and a problem
When we export data from a string field which is UTF8 - it is not simple to calculate the length after conversion to some other character representation. Therefore all the fields are length 207 after export. We could experiment with a shorter export length.
Until other solution do the following: a. export to Stata b. read the dta file into Stata c. compres (run this command in Stata)
regards Jens Lauritsen EpiData Association On 2012-01-19 13:25, epidata-list@lists.umanitoba.ca wrote:
Dear Epidata list
I have two questions for you:
- How can i get an overview of my records?(a list accessable with in
the epidata manager or entery client. 2. In epidata when i export to stata the data in stata turns out different from what i want. A. My string variables are in s207% format leaving them extremely
wide. I
have specified length in epidata to 25 (as i want a 25 character
entry)
B. I have some integer variables that i have labeled, the length
of the
integer variables are 2 (-9 to 8) these are labeled for
readability in
stata. Some of the labels such as male / female are longer than 2 but
i am
not allowed to change the length of the integer variables to above
- So
when I export to stata my labels are ma (male) and fe (female).
What am i doing wrong?
lars
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com
If you have any question, please contact MCRI IT Helpdesk for further assistance. ______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________