Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72776

Destring ICD9 without losing leading zeros

$
0
0
This topic has been approached before in this forum but not, so far as I can tell, conclusively addressed.

I have ICD9 codes in string form. I need to export them in numeric form in order to upload them into a case-mix system. I am working with Stata for PC, v13.1. I have about 5 million diagnosis codes in my dataset. Here is what I have tried:

Destring: drops leading zeros

Encode: performs erratically. According to (http://www.stata.com/support/faqs/da...ring-variable/) I have too many unique values.

egen newdx = group(string_dx) Drops leading zeros

Changing the display will not work if you know how ICD9 codes are structured -- ICD9s are not all the same length and leading zeros are meaningful.

Viewing all articles
Browse latest Browse all 72776

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>