Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: xtsum formulas


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: xtsum formulas
Date   Thu, 6 Jul 2006 15:09:09 +0100

I think this is just the programmer's (programmers') concrete 
example of -summarize- output so they can keep track of 
output layout. It is not part of the code concerned. Keeping 
odd stuff like this at the end of a program file can beat keeping 
notes on bits of {scrap|scratch} paper or in other files that 
you can mislay or forget about. Other programmers document 
special tricks, pious intentions, etc. in such places. 

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

Sebastian F. Büchte
 
> Since I am always excited about learning new things, I tried
> viewsource xtsum.ado. Everything worked nicely, but I found the
> following nine lines at the end of the ado-file and I am wondering why
> they are there.
> 
> . sum cost avgcost dcost
> 
> Variable         |      Mean   Std. Dev.       Min        Max 
> |    Observations
> -----------------+--------------------------------------------
> +----------------
> ----+----1----+----2----+----3----+----4----+----5----+----6--
> --+----7----+----8
> longlong overall | 123456789  123456789      3.154     191.56 
> |     N =12345678
> longlong overall |  44.44588   46.30909      3.154     191.56 
> |     N =12345678
>          between |             44.57574     4.4645    125.584 
> |     n =      22
>          within  |             20.41346  123456789  912345678 
> | T-bar =       6
> 
> It is not a critical thing to know but I am just curious.

> On 7/6/06, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> > Quite so. Indeed, knowing that -xtsum- is implemented as an 
> .ado file
> > (strictly, not a .do file) means that
> >
> > viewsource xtsum.ado
> >
> > will give you a view of the code, without (a) needing
> > to doing a -which- to find out precisely where the
> > file is, or (b) any risk of modifying the code.
> >
> > This tip is explained in more detail in
> >
> > SJ-6-1  pr0022  . . . . . . . . . . . Stata tip 30: May the 
> source be with you
> >        Q1/06   SJ 6(1):149--150                             
>     (no commands)
> >        tip for using viewsource to locate and view source
> >        code or text files
> >
> > and in "Thirty-three Stata Tips" from StataCorp.
> >
> > Nick
> > n.j.cox@durham.ac.uk
> >
> > Neil Shephard
> >
> > > On 7/6/06, Podestà, Federico 
> <Federico.Podesta@amm.unitn.it> wrote:
> > >
> > > > I have (I think) a simple problem: I would like to know
> > > formulas used by the -xtsum- command to obtain the betweem
> > > standard deviation and the within standard deviation.
> > > > In particular I would like to know Stata code to compute
> > > such statistics by hand solving all parts of the formulas
> > > step by step.
> > >
> > > The formulas for the methods implemented in Stata (at 
> least those I've
> > > ever had recourse to look up) are given in the manuals, in this
> > > instance it will be [XT].
> > >
> > > In this instance because -xtsum- is implemented as a do-file....
> > >
> > > . which xtsum
> > > /usr/local/stata9/ado/base/x/xtsum.ado
> > > *! version 1.0.9  06aug2004
> > >
> > > ..you can look at the code yourself by viewing the 
> relevant file in a
> > > text-editor.
> > >
> > > (Be wary of modifying the file which will break things.  
> If you want
> > > to make modifications, don't, instead clone the do-file to your
> > > personal-ado file and rename it, and make modifications to that).

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