Hi all,
I am working on a trial that includes primary care data from GP practices (32 practices). However, I have an issue with dropping some observations (rows). At this stage, each patient has multiple rows and I will reshape the data once I drop irrelevant data.
Practices provided data that goes back to 20-30 years back so I need to drop all observations that are before the randomisation date for each practice.
For example, v3 is the appointment date which is in string format. The format of the dates is inconsistent, e.g. some appointment dates are recorded as 1942 or 20-May-1998 (in 20th century) or 19-April-2012 or 17-Aug-2022 (in the 21st century) and so on.
How can I format the dates so all have the same format (MDY) and also include appointments that are after the randomisation date e.g. 23 April 2022.
Kind regards,
I am working on a trial that includes primary care data from GP practices (32 practices). However, I have an issue with dropping some observations (rows). At this stage, each patient has multiple rows and I will reshape the data once I drop irrelevant data.
Practices provided data that goes back to 20-30 years back so I need to drop all observations that are before the randomisation date for each practice.
For example, v3 is the appointment date which is in string format. The format of the dates is inconsistent, e.g. some appointment dates are recorded as 1942 or 20-May-1998 (in 20th century) or 19-April-2012 or 17-Aug-2022 (in the 21st century) and so on.
How can I format the dates so all have the same format (MDY) and also include appointments that are after the randomisation date e.g. 23 April 2022.
Kind regards,
Comment