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

Re: st: Re: ST: transferring labels


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: ST: transferring labels
Date   Fri, 12 Nov 2004 08:13:15 -0500

You can also do all of the necessary pasting in Excel, as it is much
easier to create a column of identical entries in Excel than anywhere
else. You would need to insert a columncolumn of

label var

in front of your current column A, a column of say ' (apostrophe)
between A and B, and between B and C. You'll do all of that by pulling
on the cross in the lower right corner of the cell, as you should know
in Excel. Then export the sheet into a text file as space separated. I
don't know whether Excel would put the quotes around the entries -- if
it does, go to a text editor (probably WinWord is the most obvious
choice) and replace double quotes with nothing, and then replace
single quotes that were surrounding the labels with the double quotes.
Your program is ready to run.

Stas


On Thu, 11 Nov 2004 18:13:21 -0500, Eric Uslaner <euslaner@gvpt.umd.edu> wrote:
> Hello,
> 
> I have downloaded a data set that is in 3 parts, all in Excel.  Files 2
> and 3 are data, file 1 is a list of variable names and labels. I have
> transferred the data with names to Stata, but the labels are perplexing.
>  Here is  the format of the Excel spreadsheet with the variable names
> and labels:
> 
> Column A    Column B       Column C    Column D   Column E
> varname     varlabel          divider        varname     varlabel
> etc.               etc.                                    etc.
>     etc.
> 
> Columns A&B are for data set 2 and C & D for data set 3 (though this is
> no problem--I can copy them into one column since the cases are
> identical).
> 
> Is there a way to transfer the variable labels without doing a lot of
> typing.  Stata Technical Support suggested putting each variable label
> into a do-file with quotation marks around each label (which I would
> have to type in by hand) and then pasting:
> 
> label var varname "varlabel" for each variable.
> 
> Does anyone have a more expeditous (and less tedious) way of doing this
> transfer?
> 
> Thanks,
> 
> Ric Uslaner
> euslaner@gvpt.umd.edu
> 
> *
> *   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/
> 


-- 
Stas Kolenikov
http://stas.kolenikov.name
*
*   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