Thanks a lot, Nick.
I just went through the commands of -labutil-, and found they are
quite useful. I should have known this earlier.
On 2/28/08, Nick Cox <[email protected]> wrote:
> I understand this as follows:
>
> Suppose variable -x- has values 11, 12, 13, ... and value labels "A", "B", "C", ....
>
> You want -y- to have values 111, 112, 113, ... and the corresponding value labels.
>
> Try
>
> gen y = 100 + x
> labmask y, values(x) decode
>
> Here -labmask- is in -labutil- on SSC.
>
> Nick
> [email protected]
>
> Jia Xiangping
>
> A variable in int storage type, reflecting different regions.
>
> label region code
> value
> 11 A
> 12 B
> 13 C
> 21 D
> 22 E
> 23 F
> 31 G
> 32 H
>
> Now I want to generate a new variable with a prefix "1" denoting the
> country code. But the variable still carry the codes.
> 111 A
> 112 B
> 113 C
> 121 D
> 122 E
> 123 F
> 131 G
>
> How shall I do that with -recode-? Or there are some other commands for that?
>
> *
> * 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/
>
--
Xiangping Jia
*
* 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/