trimData function

Trim longitudinal data file once an event has occurred