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]

Re: st: Stata date


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Stata date
Date   Tue, 9 Apr 2013 17:33:59 +0100

The first sentence shows a fundamental misconception.

A display format assigned to a variable has nothing to do with how
data are stored; it merely indicates how data are to be displayed.

That said, Ray's question underlines that -summarize- ignores display
format for daily dates.

Instead,

. codebook buydt

should do what Ray wants. Also, check out -summdate- (SSC).

Nick
njcoxstata@gmail.com

On 9 April 2013 17:22, Ray Hawkins <sylviantas@gmail.com> wrote:

> My date is stored in %td format, e.g.,
>
> mydate
> 19aug2005
>
> When I summarize mydate:
>
> sum mydate
>
> it produces results like the following.
>
>     Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>        buydt |   9261737    16785.61    9.022221      16771      16801
>
> Can I display the summary results in a specific format such as %td? This is
> because the data is too big and sorting takes long time to see the min and
> max dates. Or, is there a table that matches numbers to actual dates? The
> help file says that:
>
> %td dates 01jan0100 to 31dec9999 (integers -679,350 to 2,936,549)
>
*
*   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