Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Merging by intervals or subgroups


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Merging by intervals or subgroups
Date   Sun, 11 Nov 2007 12:18:10 -0500

...

You might want to check out -nearmrg- available from SSC which may help in your first problem. The second problem is more difficult, but if you can create a binned version of each of those variables it would be much easier (but would, of course, miss matches that are near each other but straddle bin boundaries).

Michael Blasnik


----- Original Message ----- From: "Malcolm Wardlaw {msbbe073}" <Malcolm.Wardlaw@phd.mccombs.utexas.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Saturday, November 10, 2007 5:39 PM
Subject: st: Merging by intervals or subgroups



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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index