Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: residuals over years


From   Christopher F Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: residuals over years
Date   Wed, 20 Oct 2004 09:24:41 -0400

On Oct 20, 2004, at 2:33, Nick wrote:

I vote for efficiency whenever possible, but
it is not clear that inefficiency is in
fact a major issue here. Stata's still
going to look at every observation to
decide whether it is true that year == `y'.

I tried the following experiments. You
can try too. Method 1 was actually
_slower_ on my machine, but there's not
much in it. The difference could be an artefact of
something or other, but it doesn't seem
a big deal either way. Of course, a couple
of little experiments are just that.
My concern was not so much for saving a few CPU cycles as pointing out the often-unexpected behavior of predict. In other statistical software, it is common that a predict will only produce in-sample values, and you have to ask for anything else. predict without an e(sample) restriction can produce confusion if, e.g., one would look at any statistics related to the predicted quantities. If all that is being done is stuffing certain of those predicted quantities in another variable and discarding the irrelevant ones, fine. But I have learned from experience that if it is possible to make the mistake of considering some aspect of that entire series when only part of it is relevant, it will eventually happen. So I think a general rule: predict what you want to predict, and make that explicit if necessary---is quite a good idea.

Kit Baum, Boston College Economics baum@bc.edu
http://ideas.repec.org/e/pba1.html

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