Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: merge by nearest date


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: merge by nearest date
Date   Tue, 8 Sep 2009 21:29:05 -0400

Joseph Wagner<joseph.wagner@wright.edu> wrote:
This is identical to finding the nearest hospital to patients, except
you don't have to calculate distance between pairs of lat/lon
coordinates, since the distance is measured in days. See e.g.
http://www.stata.com/statalist/archive/2007-01/msg00098.html
and recent threads referencing this trick, e.g.
http://www.stata.com/statalist/archive/2009-07/msg00083.html

On Tue, Sep 8, 2009 at 12:15 PM, Joseph Wagner<joseph.wagner@wright.edu> wrote:
> I am using Stata ver 8.2 and wish to merge two files each with an idcode
> and a date.  (I know that more recent versions of Stata can handle this
> more capably but funds are short at this time so I make do with what I
> have.)  None of the dates in using matches exactly with master.  I get
> the following:
>
> . tab _merge
>
>     _merge |      Freq.     Percent        Cum.
> ------------+-----------------------------------
>          1 |        585        1.82        1.82
>          2 |     31,554       98.18      100.00
> ------------+-----------------------------------
>      Total |     32,139      100.00
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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