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?
IV regression with multiple interactionsHello, I hope you could help me with this. I need to estimate three separate equations with -ivreg2…
Calculating BMI when ht and wt have been recorded with different unitsHello, I am trying to create a new variable for BMI and I have a dataset with continuous variable "…
Marginal Effects on ivprobitI'm running an ivprobit model, and I'm trying to get marginal effects out of the second stage coeffi…
Re-arrange variablesDear all, I have 30 variables in different columns. Now I want Stata to generate one new variable w…
Combining two variablesHello, i'm just working on a do-file and I'm struggeling to combine to variables. The first variable…
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