The data in LCBC are usually collected in two sets each time, one testing and one MRI. These two are usually seperated by some days to a month, but some times even more. We also miss some dates of testing for some participants. This causes some difficulties when calculating ages etc.
mutate_mean_date(data)
data | MOAS-like data |
---|
data frame
This function will create a new column named code[date], which will contain wither the mean date between MRI and test, given we have dates on both, or either one of test or MRI date we have. If both are missing, the function will add in the mean date for the specific Project and Wave of collection, in order to properly order the data in most likely chronological order.