My research database has a few tables, but I wanted to ask about how to handle longitudinal data in an export to Excel (since it's the intermediary file format to my statistical package.)
Each subject in our study is entered into a Subjects table to store their demographic information like year of birth and gender. There is no identifying information in this database.
Whenever a subject comes in for a follow-up visit, their measurements are entered into a Measurements table. The Subjects and Measurements table are linked via a unique ID. The date of their follow-up visit is recorded in the Measurements table, since any given subject will have several measurements taken.
For one of our analyses, we need to separate out the follow-up measurements into separate columns. To do this, we would specify a date range and then classify the follow-up into a category (e.g. anywhere from 6-18 weeks would be classified as a 12-week follow-up)
What I need is to export the data such that for each Subject (or unique ID), there is a Baseline measurement and then a 12-week follow-up and a 52-week follow-up in each row. So, the column headings would be "SubjectID", "Baseline measurement", "12-week follow-up" and "52-week follow-up", as opposed to how things are now, where the headings are "Subject ID", "Date of follow-up", "Measurement"
I feel like this is a common problem, but haven't been able to search my way to a solution in the archives.