This arrived truncated. However, there is an FAQ
FAQ . . . . . . . . . . . . . . . . . . . . . . . Generating the last date
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
4/05 How can I generate a variable containing the last of
several dates?
http://www.stata.com/support/faqs/data/lastdate.html
which despite its title is of some relevance.
The earliest date is just the minimum. None of the complications
that surround dates affect this point, so long as your dates
are in numeric form. Hence, if your structure is
id date_1 date_2 date_3
then the earliest date is
gen earliest = min(date1, date2, date3)
and if your structure is of
id date
----------
id_1 date_1
id_1 date_2
id_1 date_3
id_2 date_1
...
then the earliest date is
bysort id (date) : gen earliest = date[1]
Nick
[email protected]
Grosso Anthony
> with 3 columns (variables) of different dates. How can Stata
> identify/keep the earliest date for each observation?
*
* 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/