Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: excel to stata / variable names shift to the value row


From   Ron�n Conroy <[email protected]>
To   [email protected]
Subject   Re: st: excel to stata / variable names shift to the value row
Date   Mon, 28 Feb 2005 10:51:07 +0000

tapes wrote:

Hi,

I've got such experience when importing data from
excel to stata (directly copy or using insheet
command): Sometimes stata can automatically recognize
variable names from the excel file and leave them in
variable name row of the stata, but sometimes it turns
out that all the variable names shift to the value row
of the stata. In fact, the variable names in both
cases seem 'normal' and similar to each other. Any
suggestions about how to ensure stata to keep variable
names in the right place? Thank you very much.
You can force -insheet- to read the first line of the incoming file as names, using the -names- option. I cannot figure out why, on some occasions, Stata treats the first row as data, but let's face it, it does a pretty good job at guessing whether there are names there or not. Safest thing is to give the -names- option explicitly unless you can vouch for Stata's behaviour in advance.

--

Ronan M Conroy ([email protected]) Senior Lecturer in Biostatistics Royal College of Surgeons Dublin 2, Ireland +353 1 402 2431 (fax 2764) -------------------- Just say no to drug reps http://www.nofreelunch.org/

--------------------------------------------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.
If you have received this email in error please notify the
originator of the message. This footer also confirms that this
email message has been scanned for the presence of computer viruses.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of The Royal College Of Surgeons in Ireland.

--------------------------------------------------------------------------------------------------------------------


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index