Statalist The Stata Listserver


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

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


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: -mean- vs -regress-
Date   Wed, 30 May 2007 21:13:07 +0100

Exactly. It's an uneven contest from the outset. 

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

Stas Kolenikov
 
> 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 <n.j.cox@durham.ac.uk> 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
> > n.j.cox@durham.ac.uk
> >
> > 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/



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