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?
How to group several columns?I am dealing with data with information of different candidates, the results of each candidate is di…
Breusch and Pagan LM test for random effectsDear community, I am deciding among Pooled OLS, Fixed and Random Effects panel models in the presen…
Problem with MergingHi, I am trying two merge two datasets using the key ID (Neighborhood_Code). However, Im getting th…
Obtain very different results using -xtreg- and -margins- / can I store the results from -margins- in a tableWhen I run the interaction between a dummy (0/1) variable (at3) and a categorical variable (vtype), …
Calibration plot for logistic regression modelsI want to perform a calibration plot for several logistic regression models like this. But I did not…
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