Hi,
I have a dataset containing one variable identifying study participants and 30 variables containing ICD-codes (one per variable, strings). I need to identify every code indicating diabetes and generate a new variable, coded as 1 or 0 to indicate the presence or absence of diabetes. Of course I can write gen diabetes==1 if var1=="xxx" etc and repeat this up to var30. Alas there are quite a lot of different ICD-codes for diabetes so it would take a lot of time. Does anyone know of a faster way?
Best wishes,
David
Related Posts with Identifying ICD-codes in 30 different variables
Saving intermediate matrices from a loop using post?Dear Stata community, I want to save matrices from each iteration of an r-class program which I am …
Getting end date of the monthDear all, Suppose I have the following dataset Code: clear input str8 yearmonth "1960m1" "1960m2…
How to get the standard errors for marginal effects that is calculated based on estimated coefficients and a spatial matrix?I am calculated the long-run and short-run marginal effects of a variable in a spatial dynamic panel…
Qreg analysisHello, I am running QREG analysis in STATA to see difference between wages of 2 groups of persons pe…
Divide skalar/locals and input result into matrixDear all, I need to devide one scalar/local through another and input the result into a matrix. In t…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying ICD-codes in 30 different variables
Post a Comment