Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: displaying summary statistics of date variables


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: displaying summary statistics of date variables
Date   Thu, 6 Feb 2003 09:36:20 -0000

Devra Golbe

> > Is there a way to display summary statistics of (elapsed)
> > date variables
> > in  date format? For example, summary  of the following
> date variable
> > produces output which is difficult to interpret:  What, for
> > example, is the
> > latest  date in variable "date"?  15337 is difficult to interpret.
> >
> >   I have checked the manuals, the web site, and the list
> > archives to no avail.
> >
> >   summ date
> >
> >      Variable |     Obs        Mean   Std. Dev.       Min
>        Max
> >
> -------------+-----------------------------------------------------
> >          date |  317462    12376.24   1809.816       9000
>      15337

Nick Winter

> Nick Cox has probably already written something for this (-:
>
> However, the following is a quick and dirty program that'll
> do it.  It
> could be made into a more general wrapper that detects the display
> format of the variable, and only displays as dates the stats for
> date-formatted variables, etc etc.
>
> program define sumdate
> 	version 8

< snip >

> end

Nathan Woods

> you may want to try this as well.

> datesum from http://fmwww.bc.edu/RePEc/bocode/d
>    'DATESUM': module to display summary statistics for date
variables /
>     datesum displays summary distribution statistics for date /
variable(s)
> in
>    date display format.  / Author: Gary Longton, Fred Hutchinson
Cancer
>    Research Center / Support: email glongton@fhcrc.org /
Distribution-Date:

Or -summdate- from SSC.

To -summarize- the thread so far:

1. Nick Winter posted code -sumdate-, which requires Stata 8.

2. Gary Longton has -datesum- on SSC, which requires Stata 7.

3. There is an older -summdate- (N.B. spelling) on SSC, which
requires Stata 6.

Something there for almost everybody --

but in addition to these user-written programs, what is easily
overlooked
is that official Stata's -codebook- acts smartly given a date format,
so check it out
first. In fact, I'm hereby suggesting that this deserves an index
entry in the
Stata 9 manuals, which won't be issued for a while yet, and an entry
in the
.key files which -search- searches, which could be done very quickly.

Nick
n.j.cox@durham.ac.uk

*
*   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/



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