I'm a newbie, and trying to clean up an ICD9 string variable that has some errant codes. An example is 530.809999999999999 which should be 530.81
I've tried using recode, and this is what I get:
. recode ICD9CODES1 (530.8099999999999 = 530.81)
recode only allows numeric variables
Replace isn't much better:
. replace ICD9CODES1 = "530.81" if ICD9CODES1 = 530.8099999999999
type mismatch
r(109);
I'm not sure if I first need to (or should) change the ICD9 code variable to a double and then try the recode command, or is there a better way?
I've tried using recode, and this is what I get:
. recode ICD9CODES1 (530.8099999999999 = 530.81)
recode only allows numeric variables
Replace isn't much better:
. replace ICD9CODES1 = "530.81" if ICD9CODES1 = 530.8099999999999
type mismatch
r(109);
I'm not sure if I first need to (or should) change the ICD9 code variable to a double and then try the recode command, or is there a better way?