Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Identify Closest Subsequent Date
From
Julia Laskorunsky <[email protected]>
To
statalist <[email protected]>
Subject
st: Identify Closest Subsequent Date
Date
Thu, 4 Apr 2013 12:50:24 -0400
Hi everyone,
I have unique ID#s which list a court date and several release dates
(0 to 7). I would like to ask Stata to identify the closest subsequent
release date to the court date of interest. I have asked Stata to
convert all date variables to elapsed format. Here is an example of
the data (sorry if the formatting gets messed up):
ID cdate release1 release2 release3
1 16705 16799 18502 .
2 15088 15000 . .
3 16805 . . .
4 16000 15222 15899 16452
Is there a way to generate a variable that identifies a subsequent
released date (if there is one) to the court date? In the example
above the variable would identify:
ID clsdate
1 16799
2 .
3 .
4 16452
Using Stata 12. Thanks for everyone's help.
Julia
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/