Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: First date


From   Keniajin Wambui <kiangati@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: First date
Date   Thu, 31 Jan 2013 14:31:00 +0300

I am using stataIC 12.1 64bit on windows 7.
I am calculating the first date the values for a given serial number
given was entered
The data example is

time_done    ndate_added    serialNumber    dfst
8:01:50 PM    26-Feb-09    88358        72127954
4:56:27 PM    27-Feb-09    88358        61004955
12:30:27 PM    25-Mar-09    88358        45044981
10:30:14 PM    02-Sep-12    88358        81033238


I am using the following code but its giving me (12:30:27 PM
25-Mar-09    88358)  as the first data to be entered but according to
the data (8:01:50 PM    26-Feb-09    88358) was the first to be
entered.

    gen double timefst=clock(time_done, "hms")
    replace timefst=clock(time_done, "hm") if timefst==.
    format timefst %tc
    format ndate_added %tc
    gen dfst=ndate_added + timefst
    egen double fdoadd = min(dfst), by(serialNumber)

how can I solve the problem

--
Mega Six Solutions
Web Designer and Research Consultant
Kennedy Mwai
254724211786
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index