Statalist The Stata Listserver

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

st: in search of merge modification

From   "Beaulieu, Emily A" <>
To   <>
Subject   st: in search of merge modification
Date   Fri, 15 Sep 2006 13:30:22 -0400

Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by
  id k8FHUc828745
Precedence: bulk
I am hoping to be able to perform a match-merge of 2 data sets where both s=
ets have unique (country, date) observations [where the date variable is a =
STATA numeric date], but the dates in the 2 data sets, are not a direct mat=
ch.=A0 The countries will match, and what I would like STATA to do is match=
  the dates in memory to the closest preceding dates in the "using" data set=
, for any given country.=A0 I would also like to perform a separate merge, =
having STATA choose the closest following date in the data set.=A0 I have n=
o programming experience in STATA, but it seems like there should be a way =
to accomplish this.=A0 My three questions for the list are as follows:

1. Is there a simple way to accomplish this with the merge command that I h=
ave simply missed in reading everything I can find about merge?
2. Has someone already created a program to do what I am trying to accompli=
3. If the answers to 1 & 2 are "no", does anyone have suggestions for where=
  I would begin to learn how to write such a program?


Emily Beaulieu
Assistant Professor
Department of Political Science
University of Kentucky
1615 Patterson Office Tower
Lexington, KY 40506
(859) 257-9677

*   For searches and help try:

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