I have a panel data set from 1970 to 2014 on yields and prices for four different crops. I need to regress yield on prices and the controls for all four crops separately i.e run four regressions. The conrols are common in all the four crop regressions but the prices are cop specific.
For this I need a loop to repeat the regression for the four crops and also to include the price specific to the crop which is the dependent variable
Following several posts on statalist I was able to run the following loop

Code:
local m=1
foreach Yield in Crop1 Crop2 Crop3 Crop4 {
                foreach Price in Price1 Price2 Price3 Price4 {
                local Control Control1 Control2 Control3
                eststo model_`m': xtabond2 `Yield' L(1/2).`Yield' L.`Price'  `Control' i.Year, gmm(L.Yield `Price', eq(diff)laglimits(2 6)collapse) ///
                gmm(L.Yield L.Price, eq(level)laglimits(1 4)) iv(L.Year, equation(level)) twostep small robust
                local m `++m'
                }
 }
esttab model_*  , se(4) b(4) r(2)wide
However this executes 16 regressions. One for each of the four dependent variables by including the independent variable i.e. price sequentially. So I have 16 regressions instead of four.
Evidently something needs to be adjusted in my loop specifying the price variables. Any suggestions?