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]

st: how to attach labels to string values


From   Stephen Martin <stephen.martin@york.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: how to attach labels to string values
Date   Wed, 4 Jul 2012 12:13:43 +0100

I have a variable with a three digit hospital operation code.  The
first digit is always a letter and the other two digits are always
numeric (eg A10, R45, V89).

I have another file with a very brief description of the meaning of
each of these codes.  I would like to use this information to attach
labels to the operation code but the latter are not integers so I
believe that I can't use label define lblname # "label" [# "label"
...].

Is there an easier way around this apart from, say, replacing the
first digit in the operation code with a number (i.e., replace A with
1, B with 2,...)?

Thanks.

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