Bookmark and Share

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]

Strange dates [was: Re: st: Thread-Index: Ac0vkoq1llKC2ARGRdCKzJ3Uorh9sgCG7a8+]


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Strange dates [was: Re: st: Thread-Index: Ac0vkoq1llKC2ARGRdCKzJ3Uorh9sgCG7a8+]
Date   Mon, 14 May 2012 10:02:07 +0100

A quick calculation underlines that the metric here is not evident.

. di mdy(2,2,2009) -  mdy(6,23,1997)
4242

which is much more than the range of 2441 that you give. ("241" I take
to be your typo.) So, it doesn't look as if they are daily dates. (Or,
naturally, monthly, weekly, ....)

Unless someone can recognise the rule or procedure being used here, I
don't think that we can advise you. Without knowing the rule being
used, we can't relate it to any other rule.

You need to go back to the dataset providers. That's my guess.

Nick

On Mon, May 14, 2012 at 9:49 AM, Amal Khanolkar <[email protected]> wrote:

> I just received a dataset which has a 'date variable in a format I
> haven't come across before. I need help with reformatting this date
> variable so that it's similar to other date variables I have in the
> dataset.
>
> The date variable reads like this when I 'summarize' and 'decribe' it:
>
>
>
> sum  inskdat_new
>
>    Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>  inskdat_new |    305358    818.8836     613.712          1       2441
>
> . des  inskdat_new
>
>              storage  display     value
> variable name   type   format      label      variable label
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> inskdat_new     long   %d          inskdat_new
>                                              enlistment date
>
>
> -As you can see from the above,  the date has a min value of 1 that
>  corresponds to 1997-06-23 and a maximum value of 241 that corresponds
> to 2009-02-04.
>
> -How do I reformat this variable so that it's a 'float' with %d display
> format and reads like 19feb2010 when I tabulate it and with stata time
> (when checking the minimum & maximum values when I summarize the
> variable)??
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index