This is only to report that this construction does not work:
<script>
loop j=5..9
list xreg$j = varA$j varB$j varC$j
list lreg$j = null
loop foreach i xreg$j
series l$i = log($i + 1)
list lreg0$j += l$i
end loop
end loop
</script>
the error produced by gretl is
? list xreg5 = varA5 varB5 varC5
? list lreg5 = null
? loop foreach i xreg5
Unknown variable name in command
I also tried susbtituting the first (variable) list by a string but this
did not work
Finally, I solved the problem rather easily making that the name of the
list in the 'loop foreach' line be fixed:
<script>
loop j=5..9
list lista = varA$j varB$j varC$j
list xreg$j = null
list lreg$j = null
loop foreach i lista
list xreg$j += $i
series l$i = log($i + 1)
list lreg0$j += l$i
end loop
end loop
</script>
the list 'lista' is overwritten in each iteration of the first loop and
the lists I need are formed by the second loop.
But I think the first construction should work, no?
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.ea3.ehu.es