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?
Balance an unbalanced datasetHi all, I have a strongly unbalanced dataset of countries observed by year. I would like to balance…
Panel data: Creating a bilateral dataset with countries and years (replicating the dataset for each panel)Hi everyone, I have a panel dataset of exchange rate with 200 countries and 16 years, please find b…
Estimating risk difference for binary outcome in cluster RCTI am analysing data from a cluster RCT looking at the effect of an intervention (int) in health cent…
Replace missing values with values from other observationsHello, I´m stucked with my data cleaning. Below, a excerpt of my dataset is shown. I only have incl…
Weekly meansHello Everyone!! I need to obtain weekly means for some measurements. I need a weekly mean by subjec…
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