counting_process function

Process survival data into counting process format