On Tue, Jun 18, 2013 at 12:57 PM, Luis M. Carrascal
<mcnc152(a)mncn.csic.es> wrote:
Dear GRTL users,
Probably it is a stupid question, but …
how can I restrict data analyses within a loop affecting several response
variables $i, when the restriction affects each variable $i?
the line “smpl $i > 0 --restrict” does not work within this loop
(from response variable 39 to response variable 145):
loop i=39..145 --progressive
smpl $i > 0 --restrict
The trouble with this is that you haven't given gretl any clue
that the numbers 39 to 145 are supposed to refer to series.
If you use the names of the series it will work:
loop foreach i somevar..othervar
smpl $i > 0 --restrict
endloop
(You may want --replace with --restrict?)
Alternatively, use the ID numbers of the series along with the
varname() function:
loop i=39..145
string vname = varname(i)
smpl @vname > 0 --restict
endloop
Allin Cottrell