How to use ICD10 Code in a regression model in R

0 votes
I am trying to find the ICD10 codes which are causing certain disease. But ICD10 has alpha numeric classification e.g. A00.00 . There are 1000s of such classifications but I am not sure how to use them in my regression model. Any suggestion please.

Data Patient Existing ICD10 Diabetic (Y) P1 A00.10 1 P2 A00.20 0 P1 C00.1 1 P3 Z01 1 ....
Apr 11, 2022 in Machine Learning by Nandini
• 5,480 points
645 views

1 answer to this question.

0 votes

Using the concept of comorbidities is a good method to do this. This is done by my R package icd for standardized collections of diseases, such as "Diabetes," "Cancer," and "Heart Disease." There are several comorbidity maps to choose from, so you may find one that matches your interests, for example. The PCCC maps in icd can be used for children, while the others are for adults and cover a wide range of diseases.

As an example, see the vignette in the introduction. These are ICD-9 codes, although ICD-10 can be used instead.

data <- data.frame(
   visit_id = c(1000, 1000, 1000, 1000, 1001, 1001, 1002),
   icd9 = c("40201", "2258", "7208", "25001", "34400", "4011", "4011"),
   poa = c("Y", NA, "N", "Y", "X", "Y", "E"),
   stringsAsFactors = FALSE
   )
data
  visit_id  icd9  poa
1     1000 40201    Y
2     1000  2258 <NA>
3     1000  7208    N
4     1000 25001    Y
5     1001 34400    X
6     1001  4011    Y
7     1002  4011    E
icd::comorbid_ahrq(data)
CHF Valvular  PHTN   PVD  HTN Paralysis NeuroOther Pulmonary    DM  DMcx Hypothyroid Renal Liver
1000  TRUE    FALSE FALSE FALSE TRUE     FALSE      FALSE     FALSE  TRUE FALSE       FALSE FALSE FALSE
1001 FALSE    FALSE FALSE FALSE TRUE      TRUE      FALSE     FALSE FALSE FALSE       FALSE FALSE FALSE
1002 FALSE    FALSE FALSE FALSE TRUE     FALSE      FALSE     FALSE FALSE FALSE       FALSE FALSE FALSE
       PUD   HIV Lymphoma  Mets Tumor Rheumatic Coagulopathy Obesity WeightLoss FluidsLytes BloodLoss
1000 FALSE FALSE    FALSE FALSE FALSE      TRUE        FALSE   FALSE      FALSE       FALSE     FALSE
1001 FALSE FALSE    FALSE FALSE FALSE     FALSE        FALSE   FALSE      FALSE       FALSE     FALSE
1002 FALSE FALSE    FALSE FALSE FALSE     FALSE        FALSE   FALSE      FALSE       FALSE     FALSE
     Anemia Alcohol Drugs Psychoses Depression
1000  FALSE   FALSE FALSE     FALSE      FALSE
1001  FALSE   FALSE FALSE     FALSE      FALSE
1002  FALSE   FALSE FALSE     FALSE      FALSE

Diabetes Mellitus is represented by the letter "DM," whereas diabetes with complications, such as retinopathy or renal failure, is represented by the letter "DMcx." This is with the standard Elixhauser classifications as modified by the US AHRQ.

You can utilize binary flags for illness stages in any statistical or machine learning model if you have them.

Elevate your skills with our comprehensive AI ML Course.

answered Apr 12, 2022 by Dev
• 6,000 points

Related Questions In Machine Learning

0 votes
1 answer

How to load a model from an HDF5 file in Keras?

Hi@akhtar, If you stored the complete model, not ...READ MORE

answered Jul 14, 2020 in Machine Learning by MD
• 95,460 points
6,386 views
0 votes
1 answer
0 votes
1 answer

How do I create a linear regression model in Weka without training?

Weka is a classification algorithm. This is ...READ MORE

answered Mar 9, 2022 in Machine Learning by Nandini
• 5,480 points
1,403 views
0 votes
1 answer

How to add random and/or fixed effects into cloglog regression in R

The standard glm function can be used ...READ MORE

answered Apr 13, 2022 in Machine Learning by anonymous
700 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
1,046 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
1,224 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
5,909 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,154 views
0 votes
1 answer
0 votes
1 answer

How to get a regression summary in scikit-learn like R does?

In sklearn, there is no R type ...READ MORE

answered Mar 15, 2022 in Machine Learning by Dev
• 6,000 points
3,690 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP