SJ Friederich, Economics
>
> A simple question in principle about the -format- option of
> -summarize-:
> from the online help, "format requests that the summary
> statistics be
> displayed using the display format associated with the
> variables rather
> than the default g display format."
>
> Yet:
>
> . g int edate = mdy(m,d,1900+y)
>
> . l edate in 1
>
> +-------+
> | edate |
> |-------|
> 1. | 13163 |
> +-------+
>
> . format edate %d
>
> . l edate in 1
>
> +-----------+
> | edate |
> |-----------|
> 1. | 15jan1996 |
> +-----------+
>
>
> . sum edate
>
> Variable | Obs Mean Std. Dev. Min
> Max
> -------------+----------------------------------------------
> ----------
> edate | 5243770 13243.04 48.59888 13163
> 13328
>
>
> . sum edate, format
>
> Variable | Obs Mean Std. Dev. Min
> Max
> -------------+----------------------------------------------
> ----------
> edate | 5243770 13243.04 48.59888 13163
> 13328
>
>
> The output is exactly the same. Does the option not work, or I am
> misunderstanding how it operates?
There is, in effect, an extra rule not stated
here: date formats are ignored by -summarize-.
Why? One can only guess:
1. Perhaps the developers just thought it unlikely
that people really wanted that, or never got round
to implementing it.
2. Also, a problem with date formats is that it is not
obvious that the date format should be followed
for all statistics. I guess that a user might want
the mean, min, max etc. to be given as dates,
but not the standard deviation, but is that
correct. The variance of dates would
have rather strange units. Skewness and kurtosis
naturally have no units.
3. Another awkward problem is this: would there be
enough space in the -summarize, detail- display?
I guess 1. is the key.
-codebook- pays some attention to date formats,
as I recall.
On SSC, see -datesum-, -summdate-, perhaps others.
(The -findit- database doesn't show SSC materials
at this instant.)
Nick
[email protected]
*
* 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/