Hi
I have the following data set:
Pt# Visit# Time Type date
X 01 1212 Adm 13/04/2009
X 02 2128 Trnsfr 13/04/2009
X 03 2258 Trnsfr 17/04/2009
X 04 2300 Trnsfr 17/04/2009
X 05 1244 Disch 18/04/2009
Y 01 1303 Adm 11/04/2009
Y 02 1758 Trnsfr 11/04/2009
Y 03 712 Trnsfr 17/04/2009
Y 04 714 Trnsfr 17/04/2009
Y 05 1820 Disch 21/04/2009
I would like to compare the observations by Pt# such that if the time between 2 subsequent visits is less than 20min on the same day I would like to delete both occurences in order to end up with the following data set:
Pt# Visit# Time Type date
X 01 1212 Adm 13/04/2009
X 02 2128 Trnsfr 13/04/2009
X 05 1244 Disch 18/04/2009
Y 01 1303 Adm 11/04/2009
Y 02 1758 Trnsfr 11/04/2009
Y 05 1820 Disch 21/04/2009
Any thoughts on how can I approach this problem? Any advice is much appreciated.
Thanks
I have the following data set:
Pt# Visit# Time Type date
X 01 1212 Adm 13/04/2009
X 02 2128 Trnsfr 13/04/2009
X 03 2258 Trnsfr 17/04/2009
X 04 2300 Trnsfr 17/04/2009
X 05 1244 Disch 18/04/2009
Y 01 1303 Adm 11/04/2009
Y 02 1758 Trnsfr 11/04/2009
Y 03 712 Trnsfr 17/04/2009
Y 04 714 Trnsfr 17/04/2009
Y 05 1820 Disch 21/04/2009
I would like to compare the observations by Pt# such that if the time between 2 subsequent visits is less than 20min on the same day I would like to delete both occurences in order to end up with the following data set:
Pt# Visit# Time Type date
X 01 1212 Adm 13/04/2009
X 02 2128 Trnsfr 13/04/2009
X 05 1244 Disch 18/04/2009
Y 01 1303 Adm 11/04/2009
Y 02 1758 Trnsfr 11/04/2009
Y 05 1820 Disch 21/04/2009
Any thoughts on how can I approach this problem? Any advice is much appreciated.
Thanks