Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Claude Beaty <cbeaty1@jhmi.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: RE: Combining multiple observations by an ID variable |
Date | Tue, 12 Jun 2012 21:18:15 +0000 |
Yes, I do. But each visit identifier is unique, like the ID codes. Claude A. Beaty Jr., M.D. Halsted Surgical Resident Cardiac Surgery Research Fellow The Johns Hopkins Hospital -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Swanquist, Quinn Thomas Sent: Tuesday, June 12, 2012 5:16 PM To: statalist@hsphsun2.harvard.edu Subject: st: RE: Combining multiple observations by an ID variable Do you have an identifier for visit number (if not you could use date). Sort as follows: sort IDcode visit then merge many to one as follows: merge m:1 IDcode using "usingfile" Quinn Swanquist qswanqui@utk.edu -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Claude Beaty Sent: Tuesday, June 12, 2012 5:02 PM To: statalist@hsphsun2.harvard.edu Subject: st: Combining multiple observations by an ID variable All, I have a large dataset of observations in which individuals (~40,000 ID codes) were evaluated multiple times (5-10 visit numbers per individual) on over 70 variables. However, the data has been arranged so that each visit number is an observation, instead of each individual ID code as an observation. I need to merge this file with another file sorted by individual ID codes. How do I rearrange this data so that it is arranged by ID codes with consecutive follow up visits? Thanks Claude A. Beaty Jr., M.D. Halsted Surgical Resident Cardiac Surgery Research Fellow The Johns Hopkins Hospital * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/