Converting Data from Long to Wide Format

  • I was wondering if there is an established script for converting the text file data available in release 4.0 or 3.0 to to wide format, so that all observations about one study participant is in one row?
  • Similarly, I was wondering if there is an established script for converting the long format data available in nda3.0.Rds to wide format, so that data about one study participant is in one row? My understanding of the data is multiple rows correspond to one study participant, with each row reflecting the different measuring events (baseline, 6 month, 1 year, 18 month…) when the subject id is the same. Using a simple matching based on subject ID and a couple of such identifier variables leads to multiple identical columns, some column values that are taken only at baseline are repeated in each of the observations.

Hi, we currently don’t have an established script for converting the format. Here are functions in Python/R that may be helpful. Python/R are all implemented in our ABCD docker