Hi everyone
I've been trying to find a solution for the following problem without any success so far. I'm doing a study about chronic kidney disease in humans and I want to create a dummy variable showing at what date in the followup the definition was first met. This seemed like a very common problem in medical research but I haven't found any suggestions online on how to achieve this.
Chronic kidney disease is defined as having a measure of renal function (egfr) in a certain range (<60) for a certain period of time (6 months). The data format is basically one observation per egfr measure with a date variable and a name variable for each individual studied.
In this example, fred would first fulfill the definition on 17jun2014 (=19891) and joe on 04sep2015 (=20335).
Now, I want to create a dummy variable (by name), indicating when the definition was met, i.e. =1 on 17jun2014 for fred and on 04sep2015 for joe.
May I ask for your suggestions?
Regards
Fabian
I've been trying to find a solution for the following problem without any success so far. I'm doing a study about chronic kidney disease in humans and I want to create a dummy variable showing at what date in the followup the definition was first met. This seemed like a very common problem in medical research but I haven't found any suggestions online on how to achieve this.
Chronic kidney disease is defined as having a measure of renal function (egfr) in a certain range (<60) for a certain period of time (6 months). The data format is basically one observation per egfr measure with a date variable and a name variable for each individual studied.
Code:
clear input str4 name long date_sample float egfr "fred" 19628 55.36556 "fred" 19631 70.7245 "fred" 19661 47.7245 "fred" 19680 51.90283 "fred" 19891 35.43642 "fred" 19951 41.67347 "joe" 19908 88.86351 "joe" 19914 40.65486 "joe" 19939 100.1254 "joe" 20110 44.29079 "joe" 20213 54.31298 "joe" 20335 48.20621 "joe" 20395 11.85982 "joe" 20488 45.4603 end format %d date_sample
In this example, fred would first fulfill the definition on 17jun2014 (=19891) and joe on 04sep2015 (=20335).
Now, I want to create a dummy variable (by name), indicating when the definition was met, i.e. =1 on 17jun2014 for fred and on 04sep2015 for joe.
May I ask for your suggestions?
Regards
Fabian
Comment