Hello,
I am working with a dataset with glomerular filtration values (eGFR) and their dates. I need to create the variable CKD, which is =1 on the first date on which the criterion of having been at least 90 days with an eGFR<60 is met. It is not enough to consider only the immediately previous analytical determination, because it may be the case that this is less than 90 days ago, so it would be necessary to take into account the determinations prior to this one.
Thank you!
Here is the data example:
I am working with a dataset with glomerular filtration values (eGFR) and their dates. I need to create the variable CKD, which is =1 on the first date on which the criterion of having been at least 90 days with an eGFR<60 is met. It is not enough to consider only the immediately previous analytical determination, because it may be the case that this is less than 90 days ago, so it would be necessary to take into account the determinations prior to this one.
Thank you!
Here is the data example:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(id date eGFR) 1 18562 47.32877 1 18667 79.49444 1 18791 55.90679 1 18962 80.51045 1 19030 75.23867 1 19100 71.27572 1 19325 68.78225 1 19432 63.01459 1 19656 79.49444 1 19757 58.82726 1 19898 67.57719 1 19969 76.62321 1 20139 68.78225 1 20278 56.86056 1 20314 54.97198 1 20395 81.03076 1 20524 71.27572 1 20555 66.39872 1 20733 71.27572 1 20804 65.245995 1 20894 68.78225 1 20955 79.49444 1 21105 51.41184 1 21236 70.014786 1 21388 57.83385 1 21482 64.11821 1 21661 81.55958 1 21935 75.23867 1 22020 65.245995 1 22134 84.92532 1 22145 91.40887 1 22148 82.64371 1 22182 79.49444 1 22362 59.84139 1 22456 58.82726 1 22698 58.82726 1 22957 79.99842 1 22959 81.55958 1 22963 82.09715 1 22971 76.62321 2 21510 62.95226 2 21559 52.83544 2 21664 65.25058 2 21846 58.64754 2 21930 61.84075 2 22088 52.83544 2 22385 47.68377 2 22557 53.75511 2 22743 53.75511 2 22841 67.65491 3 20045 63.8017 3 20111 62.65739 3 20157 58.32484 3 20235 50.68774 3 20360 59.37281 3 20482 57.2991 3 20573 55.31163 3 20710 59.37281 3 20830 49.81756 3 20992 46.5021 end format %dCY-N-D date
Comment