Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Matching the closests dates of lab results across visists by patients

From   Miguel Angel Luque Fernandez <>
To   <>
Subject   st: Matching the closests dates of lab results across visists by patients
Date   Sun, 18 Dec 2011 09:00:59 +0000

I have a hierarchical
 dataset of visits by patients.
I would like to match, using dates, the 
lab results with the date of the closest visit, moving the value
of the lab result to the row of the closest visit according to the lab 
and visit dates (i.e: lab value 382 have to be moved to the row of the 
visit 25-Dec-2008, see here below a dataset example)

Thanks a lot in advance,
Miguel Angel Luque Fernández

patient    lats_contatc_dmy    lab_dmy    CD4A
1015    31dec2007        
1015    30jan2008        
1015    29feb2008        
1015    30mar2008        
1015    29apr2008        
1015    29may2008    23dec2008    382
1015    28jun2008        
1015    28jul2008        
1015    27aug2008        
1015    26sep2008        
1015    26oct2008        
1015    25nov2008        
1015    25dec2008    26oct2009    429
1015    24jan2009        
1015    23feb2009    03jun2010    444
1015    25mar2009        
1015    24apr2009        
1015    24may2009        
1015    23jun2009        
1015    23jul2009        
1015    22aug2009        
1015    21sep2009        
1015    21oct2009        

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index