I'm trying to figure out how to match/merge data in a one-to-one one-to-many context using a range.
Specifically, I want to take an observation name(1) and date(2) and match it to another dataset which has a name(1) and a date range from beginning(3) to end(4) as well as other information.
In a related problem I need to merge a company(1) and an accounting variable(2) to all remaining companies with accounting variables in a certain range, lets say +/- 10%.
Is there a preferred way to do this in Stata. I am building routines for this but they use a bunch of local variables and loops and I don't think it's getting the right answers. Any help would me much appreciated.
Malcolm
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/