Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: --insheet--reading an excel file where row 1,2 are variable names and labels


From   Neil Shephard <nshephard@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: --insheet--reading an excel file where row 1,2 are variable names and labels
Date   Thu, 23 Sep 2010 14:55:18 +0000

On Thu, Sep 23, 2010 at 2:48 PM, Amanda Fu <mandy.fu1@gmail.com> wrote:

> Then my question is: is there any easy way to let Stata name the
> variables using first row and define labels using the second row when
> reading a data set from excel file?

No, Stata's -insheet- just doesn't work like that.

I'd remove the second row from your CSV file.  You can now -insheet,
names- (i.e. specify the -names- option when insheeting)  so your
first row of variable names is recognised, then write your do-file to
label these variables.

Neil

-- 
"One should as a rule, respect public opinion in so far as is
necessary to avoid starvation and to keep out of prison, but anything
that goes beyond this is voluntary submission to an unnecessary
tyranny, and is likely to interfere with happiness in all kinds of
ways..." - Bertrand Russell

Email - nshephard@gmail.com
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index