I have a longitudinal dataset and would like to generate a visit number for each patient. For example patient ID#1 could have visit 1, 2, 3; patient ID#2 could have visit 1, 2,3, 4.
Is there a way to do this? I show the patient id variable (ptid) and date variables below:
Thank you,
Al Bothwell
Is there a way to do this? I show the patient id variable (ptid) and date variables below:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3 ptid float(datebirth dateadmit) "49" 13599 20702 "114" 13853 20760 "150" 13853 20789 "114" 13853 20758 "150" 13853 20784 "" 13853 20770 "" 13853 20773 "114" 13853 20760 "150" 13853 20795 "" 13853 20771 end format %td datebirth format %td dateadmit
Thank you,
Al Bothwell
Comment