Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: recode non-numerical values

From   Jet <>
Subject   st: recode non-numerical values
Date   Mon, 2 May 2011 22:16:59 -0400

Hi, everyone,

      I have a question regarding matching of nonnumerical values.
Suppose the original data looks like this:

   ID     Drug ID
    1      d06662
    2      d06665
    3      d04878
    4      d05048

    Now  suppose d06662 is a drug for hypertension, which I want to
code into "1", and all else into "0". I tried to destring the
variable, but it does not allow me doing so since it contains
characters. Any suggestion to handle this situation?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index