Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Re: RE: re: Re: forvalues, panel data

From   Christopher Baum <>
To   "" <>
Subject   st: Re: RE: re: Re: forvalues, panel data
Date   Mon, 4 Oct 2010 09:10:24 -0400

On Oct 4, 2010, at 2:33 AM, Nick wrote:

> Well, the original poster had 11 values. I think Kit's right that his method is superior for large problems or as a systematic approach for doing this repeatedly, but my advice was in the context of a very small specific problem. And anyone who doesn't check key coefficients very carefully deserves to get lousy results.

Point well taken. The issue I have (which comes up all the time with my students) that once having found a 'quick and dirty' way to solve a little problem, even if it is a but cumbersome, they stick with it when they face a larger version of the problem, or the need to apply the same transformation repeatedly. Sometimes it is well worth learning how to solve a problem efficiently even when you don't save that much typing or time doing so, as then the next time you have that 'canned' solution at hand.

A good example is the use of -forvalues- or -foreach-. Strictly speaking you don't have to use them, but when the number of values over which to iterate exceeds a handful, you're crazy not to do so, on the grounds of both saving time and reducing errors.


Kit Baum   |   Boston College Economics & DIW Berlin   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index