Bookmark and Share

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: FW: producing value labels when value has decimal point


From   "Miller, Ann C." <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: FW: producing value labels when value has decimal point
Date   Wed, 11 Aug 2010 16:12:48 -0400

-----Original Message-----
From: Miller, Ann C. 
Sent: Wednesday, August 11, 2010 4:12 PM
To: '[email protected].'
Subject: producing value labels when value has decimal point


Dear Statalist, 

I have been given a float variable in which the values are things like 1.1 ,1.2, 2.1, 2.2, 2.3.  These values correspond to diagnoses in a medical record, for example 1.1=diarrhea, 1.2=nausea/vomiting/other GI . and so on. I would like to create labels for this variable,but so far have been unable. I created a program to do this (see below) but the error message I got back was "may not label 1.1". I then tried to create a cloned variable and "recast" it as a string, and got the error message "string invalid". Then I tried replacing the decimal points by using "replace clonese_code1=12 if clonese_code1==1.2 " and got "0 real changes made" despite there being 67 of them with a code of 1.2.  Do you have any suggestions about what I'm doing wrong here? There are 10 variables with the same value codes corresponding to 10 possible episodes of a side effect. My eventual objective is to try to identify if a person has at any time had (for example) hepatitis as a side effect in any o!
 f the 10 visits.  Any advice about what I'm doing wrong here would be most appreciated. 


Sincerely, 
Ann

PS: 
My program was as follows:

# delimit ;

lab def se_code1 
1.1 "Nausea and vomiting" 
1.2"Diarrhea" 
2.1"Hepatitis"
2.2 "Transaninase increase"
3.1 "Renal insufficiency"
4.1 "Hypothyroidism"
5.1 "Hypokalemia"
6.1 "Arthralgia"
6.2 "Myalgia"
7.1 "Anaphylaxis"
7.2 "Pruritis"
7.3 "Rash"
8.1 "Tinnitus"
8.2 "Ototoxicity"
9.1 "Depression"
9.2 "Psychosis"
10.1 "Peripheral neuropathy"
10.2 "Seizure"
11 "Hypotonia"
;

lab val se_code1 se_code1;
lab val se_code2 se_code1;
lab val se_code3 se_code1;
lab val se_code4 se_code1;
lab val se_code5 se_code1;
lab val se_code6 se_code1;
lab val se_code7 se_code1;
lab val se_code8 se_code1;
lab val se_code9 se_code1;
lab val se_code10 se_code1;

# delimit cr



*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index