NIS has 40 Diagnoses (dx1 to dx40) listed for every patient. I am trying to find how many have diabetes. There are a lot of ICD10CM codes for diabetes between E0800 to E1399.
I have written this
gen diabetes = 0
foreach var of varlist dx1-dx40 {
replace diabetes=1 if `var'=="E0800"
replace diabetes=1 if `var'=="E0801"
replace diabetes=1 if `var'=="E0802"
replace diabetes=1 if `var'=="E0803"
....
}
but it will take an hour to write in all the diagnoses codes.. is there anything simpler?
Related Posts with How do you identify ICD-10-CM codes in Nationwide Inpatient Sample (NIS) using STATA?
Local macro list and tuplesI am in need of two different tuples lists, so I would like to store one set as a local and call the…
Simple loop questionDear Listers, I would like to ask you a very simple question regarding loop. I want to make a vari…
How to recode data with multiple groupsHi Everyone, I am fairly new to stata and I am looking at cancer data. I have histology groupings f…
dummy for panel dataHi, how to create dummy variable for panel data? I want to create a dummy for 130 districts for 3 ye…
Issues with Hausman-Wu testHi everyone, I am having issues with running a Hausman-Wu test. The output is as follows: "hausman…
Subscribe to:
Post Comments (Atom)
0 Response to How do you identify ICD-10-CM codes in Nationwide Inpatient Sample (NIS) using STATA?
Post a Comment