Dear John:
Perhaps Exercise 1 ("Aggregating vs from Long-to-Wide", in Part D, accessed from the navigation "EpiData" at http://www.tbrieder.org is precisely what covers your problem. Download the Task and solution PDF files there.
Regards,
Hans
epidata-list@lists.umanitoba.ca wrote:
I have a data file with multiple observations for each person and each of the multiple observations is on a separate record. A person may have one, two, three, or more observations. I need to create a file with the first and last observation on the same record for each person. Each record has a person's id variable, date, and observation number.
If I could first identify the first and last observations and then write them out to separate files, then it would be possible to rename the variables except for the id variable and merge the files using the id variable. I searched the archive for something similar with no success.
Thanks,
John