Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: re: total


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: re: total
Date   Mon, 26 Jan 2009 17:46:48 -0000

I guess it is what -total- is doing for that matter, although I haven't
looked. 

My point was this: calling anything that calls anything ... that calls
-summarize- is necessarily less efficient than calling -summarize-
alone. A user might be hard pushed to notice but the point remains. 

In fact, you might get better performance with Mata in at least some
circumstances. I can't comment much on plug-ins. I can see that in some
circumstances some programmers might prefer to write plug-ins, but it
seems to me much easier to use Mata, especially if you wish to make your
programs as portable as possible across platforms. 

I was aware of -tabstatmat-, as its original author, although naturally
others may not be. 

Nick 
[email protected] 

Sergiy Radyakin

On Mon, Jan 26, 2009 at 12:02 PM, Nick Cox <[email protected]> wrote:
> If you wanted to embed similar code in a do file or program to be used
> frequently, you could for efficiency rewrite using -summarize,
> meanonly-.
>
I think this is exactly what -tabstat- is doing, in particular it is
already aware of which statistics can be obtained with which commands
fastest:
class 1 : available via -summarize, meanonly-
class 2 : available via -summarize-
class 3 : available via -detail-
It then loops over variables and computes those statistics. Not very
efficient, but it works.
I wrote a plugin with a limited set of statistics (means, totals,
freqs, weighted proportions) but much better performance and it
outputs results in matrices, ready for XML_TAB to output them to
Excel.
TabStatMat by Austin Nichols will combine r()-saved results to
matrices after tabstat.


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index