Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
Surgery.dta: PatientID SurgeryDate
Hospital.dta: PatientID AdmissionDate DischargeDate
There are usually multiple records per PatientID in both data sets and I would like to match any records in Surgery.dta with corresponding records in Hospital.dta where SurgeryDate is between AdmissionDate and DischargeDate.
Typically, my solutions are inelegant and inefficient, usually involving -reshape- (which is very slow when the number of records per PatientID is large). Does anyone know of a good method for doing this efficiently in Stata, or at least a user-written program that can easily be invoked to do this?
Thanks in advance,
Joe Canner
Johns Hopkins School of Medicine
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/