Announcement

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

  • data with both ICD9 and ICD10 - please help

    Hi,

    I have a PHC4 dataset that has both ICD9 and 10 codes merged in the same variables (for example admitting diagnosis, billing diagnoses). I've been trying to clean up the data a little and have been having difficulty doing so with the merged data. I'm ultimately trying to see the most common diagnoses for descriptive studies, but also be able to organize it better so I can run regression analyses.

    for example:
    the below code works
    "icd10 generate admdescr = admdx, description" and created a new variable with descriptions
    but
    "icd9 generate admdescr = admdx, description" does not as it states there are variables that are not ICD9 codes (which is true, although the ICD10 version worked)

    I thought about trying to divide the data into a ICD9 vs ICD10 section to clean it up, and then when I re-merge it just create new variables (aki, dm, etc) to help with the regression. I'm not sure if thats the best or most efficient method. I've tried reading the official STATA ICD help materials and it hasnt helped.

    Any advice would be appreciated

  • #2
    Hi Jessica and welcome to Statalist!

    I would definitely try to separate the ICD9 and ICD10 codes into different variables, especially if there is some clean way to split them (i.e. they are separated by a space, comma, semicolon, etc).

    Also, it will be *far* easier for people here to help you if you could include 30-40 obs of your data using Stata's dataex command. If you're not familiar with dataex (and most Stata users aren't) I created a Youtube tutorial here. (I made it too long--feel free to watch at 2x speed, and you may only need the first 6 minutes) .
    Last edited by David Benson; 22 Feb 2019, 15:44.

    Comment


    • #3
      Hi Jessica,

      The key to your problem with the icd9 commands is this (see [D] icd9):
      icd9 check verifies that varname contains defined ICD-9-CM codes and, if not, provides a full report on the problems. It is a good idea to begin with this command and fix any potential problems before proceeding to other icd9 commands. However, the check subcommand is also useful for tracking down problems when any of the other icd9 commands tell you that the “variable does not contain ICD-9 codes”.
      That said, I believe the manual entry for icd10cm describes the exact problem you have. See Example 1 in [D] icd10cm, which shows creating an indicator based on some external criterion (e.g. date of the record) and then applying subsequent commands with an if qualifier. You'll see in both manual entries that all the data management commands take an if qualifier.

      Note: I mention the icd10cm command because icd9 only supports ICD-9-CM codes, so I assume you meant icd10cm above.

      Comment

      Working...
      X