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

st: Re: Merging by intervals or subgroups

From   "Michael Blasnik" <>
To   <>
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}" <>
To: <>
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.

*   For searches and help try:

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