Statalist The Stata Listserver

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

st: Foreach nested in Foreach

From   Socrates Mokkas <>
Subject   st: Foreach nested in Foreach
Date   Wed, 18 Oct 2006 15:27:00 +0100

Hi All,

I have the do file below and apart from other problems tah one I have is that Stata says that "option foreach is not allowed". Any suggestions? Can you identify other problems with the code?

su group, meanonly
foreach i of num 1/`r(max)' {;
levelsof bvd_id_number, local(levels)
foreach l of local levels {;
local k=1
while `k'<=`year_count' if bvd_id_number==`l' {;
replace gamo=gamo + (tax[_`l']-tax[_`k'])*ratio_assets[_`k']
local k=`k'+1

Many thanks.

*   For searches and help try:

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