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]
Re: st: Generating String variable containing `" & "'
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Generating String variable containing `" & "'
Date
Mon, 6 Jan 2014 11:25:18 +0000
Anwar said that -x- is string. That being so, -destring- it first.
(I am relying here, necessarily, on the examples given being
sufficient to understand the problem.)
Nick
[email protected]
On 6 January 2014 11:15, Nick Cox <[email protected]> wrote:
> Your aim is misguided. A string variable cannot itself have string
> labels (or numeric labels for that matter). You can label the numeric
> values in -x- with the values of -y- as value labels. See
>
> -findit labmask-
>
> or
>
> -findit sencode-
>
> for possible solutions. Each application of -findit- will identifiy
> download sources and documentation for the program in question.
On 6 January 2014 11:09, Dudekula, Anwar <[email protected]> wrote:
>
>> This seems to be an obvious question but somehow , I am not able to get it .
>>
>> I have two string variables x , y as follows
>>
>> Index x y
>> 1 74170 COMPUTED TOMOGRAPHY, ABDOMEN; WITHOUT CONTRAST MATERIAL
>> 2 73725 MAGNETIC RESONANCE ANGIOGRAPHY, LOWER EXTREMITY
>> .
>> .
>> .
>> .
>> .
>> .
>> 1000
>>
>>
>> I want to generate a string variable z , in the following format corresponding the observations 1, 2 :
>>
>> label define singleDXCCSlabel 74170 `"COMPUTED TOMOGRAPHY, ABDOMEN; WITHOUT CONTRAST MATERIAL"', modify
>> label define singleDXCCSlabel 73725 `"MAGNETIC RESONANCE ANGIOGRAPHY, LOWER EXTREMITY"', modify
>> .
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/