Code:
local ipv "angry fear intimacy_idx cont12_idx ev12_idx pv12_idx sv12_idx ipv_ovall_idx"
local ipv_12_entire "cont12_idx ev12_idx pv12_idx sv12_idx cont_idx ev_idx pv_idx sv_idx"

* IPV outcomes
eststo clear
foreach outcome of local ipv {
eststo `outcome'_demo: reg `outcome' arm_free `demo_controls', vce(cluster new_csps)
}

estout * using "${Oleaf}/REG_IPV/panelA_ipv.tex", replace


* Violence indexes (12 months VS entire marriage)
eststo clear
foreach outcome of local ipv_12_entire {
eststo `outcome'_demo: reg `outcome' arm_free `demo_controls', vce(cluster new_csps)
}

estout * using "${Oleaf}/REG_IPV/panelA_ipv_12_entire.tex", replace

QUESTION:
If I do the above by running two separate regressions, it works as intended.
However, I would like to run the two locals "ipv" and "ipv_12_entire" inside a loop.
I did the following.
Instead of looping over two locals as I'd like, the code below is looping every variable inside each local.
Basically, the code below produces 16 .tex files (8 variables in local "ipv" and 8 variables in local "ipv_12_entire").
Is there a way to write a loop with grouping locals? I just want to produce 2 .tex files.


Code:
loc i = 1

eststo clear
foreach outcome of local `ipv' `ipv_12_entire' {

eststo `outcome': reg `outcome' arm_free `demo_controls', vce(cluster new_csps)

estout * using "${Oleaf}/REG_IPV/panelA_`outcome'.tex", replace

loc i = `i' + 1
}​​​​​​​
​​​​​​​