Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • icd9, invalid codes

    Hi all,

    I am working with HCUP NIS files for year 2014. I run the following code:
    . icd9 check DX1, gen(invalid)
    (DX1 contains 2343 missing values)

    DX1 contains invalid codes:

    1. Invalid placement of period 0
    2. Too many periods 0
    3. Code too short 0
    4. Code too long 0
    5. Invalid 1st char (not 0-9, E, or V) 1,042
    6. Invalid 2nd char (not 0-9) 0
    7. Invalid 3rd char (not 0-9) 0
    8. Invalid 4th char (not 0-9) 0
    9. Invalid 5th char (not 0-9) 0
    10. Code not defined 0
    -----------
    Total 1,042
    How can I get around the invalid codes? Also, the variable "invalid" all are "Defined code or missing".

  • #2
    The message tells you that you have 1042 observations where the first character of the supposed ICD9 code is not 0-9, E, or V. You need to look at your data and see what those codes are and if you can figure out what they should be. Perhaps the following example code will help.
    Code:
    generate ch = substr(DX1,1,1)
    tab DX1 if real(ch)==. & !inlist(ch,"E","V")

    Comment


    • #3
      It worked! Thank you so much William Lisowski

      Comment

      Working...
      X