Statalist The Stata Listserver


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

Re: st: RE: -mean- vs -regress-


From   "Stas Kolenikov" <[email protected]>
To   [email protected]
Subject   Re: st: RE: -mean- vs -regress-
Date   Wed, 30 May 2007 12:09:02 -0500

Well think of -regress- as a single line of Mata code -- even though
compiled, whatever you do with the means and variances, you would have
to have a few lines of code, which would translate into a bigger obj
file, etc.

On 5/30/07, Nick Cox <[email protected]> wrote:
-mean.ado- is a front end for -_svy_summarize.ado- whether you
have -svy- stuff or not. The latter poses an overhead
of interpretation that is more substantial than
that imposed by -regress.ado-, which is a front end for the
built-in -_regress-. I didn't inspect -_svy_summarize- closely,
but I suspect that is most of the answer.

Stas does not mention any comparison with any minimal mean
program that would use Mata to get a view on a variable
and then calculate the mean. My own experiments show that
I can't beat -regress- for this problem.

Nick
[email protected]

Stas Kolenikov

> just a comment: I am running some simulations, and I see vividly in
> the processor time spent that -regress- (with a single predictor) is
> about five times faster than -mean-. One would think that estimating
> the mean is simpler than estimating regression... at least that's what
> we teach undergrads in our intro stat classes :)). It probably means
> that Stata Corp. has perfected the matrix operations behind -regress-
> while -mean- has received about 100 times less attention. So if you
> need a sample mean (with a CI / variance estimate) of a single
> variable, without the bells and whistles like -over-, you are better
> off running -reg y- rather than -mean y-.

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


--
Stas Kolenikov
http://stas.kolenikov.name
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index