reformat function

This function changes the format of the longitudinal data from wide format to long format