Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: how to attach labels to string values
From
Stephen Martin <[email protected]>
To
[email protected]
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/