Statalist


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

st: re: loop over files, storing r(class), create new dta file


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: re: loop over files, storing r(class), create new dta file
Date   Thu, 6 Sep 2007 07:41:48 -0400

B.Water wants to loop over a bunch of commands and store something from each in a new Stata datafile.
Earlier today I posted a message (with the wrong subject line, sorry) suggesting the slideshow "A little bit of Stata programming..." to another user. B.Water will find that useful. The slideshow in expanded form is Appendix B of my book.

Re the notion of storing something from each trip through the loop, B.Water should -help post-. The -post- and -postfile- commands will allow him to store any number of items (string and numeric) as a new observation in a separate Stata dataset. My earlier posting

http://www.hsph.harvard.edu/cgi-bin/lwgate/STATALIST/archives/ statalist.0709/Date/article-17.html

illustrates that trick (as well as the use of -forvalues-; B.Water probably needs -foreach-).

Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.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