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

st: Forvalues with Dates


From   "Eric G. Wruck" <ewruck@econalytics.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Forvalues with Dates
Date   Fri, 21 Oct 2005 00:33:29 -0400

I have found forvalues to be a huge help & have done things like

forvalues y=1997(1)1999 {
forvalues m = 1(1)12 {
replace amount_`y'_`m' = .....
}
}


But my problem is that I actually have to process the last couple months of 1996 and the first few months of 2000 as well. So it didn't seem like I could handle this within the forvalues block & therefore have to treat those months separately outside these loops. Is there a way to go through say November 1996 through April 2000 with two forvalues loops?

Thanks,

Eric

--

===================================================

Eric G. Wruck
Econalytics
2535 Sherwood Road
Columbus, OH 43209

ph: 614.231.5034
cell: 614.330.8846
eFax: 614.573.6639
eMail: ewruck@econalytics.com
website: http://www.econalytics.com

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