Notifications
Clear all
STATA Programming
2
Posts
2
Users
0
Reactions
432
Views
Topic starter
Suppose I want to work on patients with heart failure, which has a broader ICD code of I50, but in order to separate that patient, we have to add all the subcodes separately. Is there any way to include all the I50x subcodes?
Posted : 15/05/2024 11:13 am
Use this bootstrapping substr command as below in order to modify per your variable change variable name and ICD code make sure the ICD code is upper case
{
gen acutestroke_new = 0 forvalues i = 1/40
replace acutestroke_new = 1 if substr(i10_dx`i', 1, 3) == "I63"
}
Yasar Sattar MD MS
CEO AXEUSCE, LLC
Posted : 28/02/2025 6:05 pm