|From||Ronán Conroy <email@example.com>|
|Subject||Re: st: excel to stata / variable names shift to the value row|
|Date||Mon, 28 Feb 2005 10:51:07 +0000|
Hi,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.
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.