Statalist The Stata Listserver


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

st: AW: Labeling variables


From   "Thomas Erdmann" <tom.erdmann@stud.unibas.ch>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Labeling variables
Date   Wed, 15 Nov 2006 13:08:52 +0100

Sorry, a single loop will do I guess...

foreach X of varlist n* {
  =09label variable `X' `X'
  =09}



- Tom


-----Urspr=FCngliche Nachricht-----
Von: Thomas Erdmann [mailto:tom.erdmann@stud.unibas.ch]
Gesendet: Mittwoch, 15. November 2006 12:51
An: 'statalist@hsphsun2.harvard.edu'
Betreff: Labeling variables


Hi,

Is there a command that tells Stata to set the label of each variable to th=
e
variable name?

Or, alternatively, loading my file with -insheet- , can I tell Stata that
one row (using long data) contains the information for the variable labels?


Details: I have data in the long form, the column headers are detailed
descriptions of the items. Basically I would like to use those names as
labels and then rename the variables to shorter names directly in Stata, to
avoid errors in this process:

Pretty easy problem I guess, but only found more complicated alternatives
and no straightforward solution, thanks for your feedback.

- Tom


*
*   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