Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: importing data from excel


From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: importing data from excel
Date   Wed, 19 Jul 2006 22:48:27 +0200

Julia wrote:

after having imported data from Excel, I noticed that for some variables
Stata cutted the decimal places and considered these variables as two
seperate variables.
E.g. Var1: 15,25 --> Var1: 15, Var2: 25
Strangely, this does not happen to all comma-containing variables
(although they all have the same format in Excel). Anyone a clue why this
happens and what can be done about it?
---------------------------------------

Keto suggested to replace commas by periods in the Excel file. This would
work only for text cells, not for numeric cells.

Ron=E1n recommended to either to change Excel to display decimal periods,
or tell Stata to display decimal commas (-set dp comma-).

I assume we work in Windows. You don't change the Excel settings but
the Windows settings to display decimal periods. In Windows XP it is:
     [Start] > Settings > Control panel > Regional and Language Options

Stata would never understand decimal commas in input, so the solution
is to choose the Windows settings to display decimal periods.

Hope this helps
Svend

________________________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C,  Denmark
Phone, work:  +45 8942 6090
Phone, home:  +45 8693 7796
Fax:          +45 8613 1580
E-mail:       sj@soci.au.dk
_________________________________________________________

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index