Or alternatively you can try loop i=1..n
and use 6*i inside the loop if you need the numbers you wrote as an example. daniel -----Original Message----- From: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it> To: Gretl list <gretl-users(a)lists.wfu.edu> List-Post: gretl-users@gretlml.univpm.it Date: Tue, 25 May 2010 08:08:26 +0200 (CEST) Subject: Re: [Gretl-users] Loop question On Tue, 25 May 2010, Henrique Andrade wrote: > Dear Gretl Community, > > I'm trying to use a loop index inside a script but I don't know how. According > to "Gretl User’s Guide" the syntax looks like this: > > loop i=1..24 > > But I just need the points where "i" is equal to 6, 12 and 24. Something like > this: > > loop i=6;12;24 > > How can I do that? For example, this way: <script> matrix foo = { 6, 12, 24 } n = cols(foo) loop for i=1..n bar = foo[i] print bar end loop </script> Riccardo (Jack) Lucchetti Dipartimento di Economia Università Politecnica delle Marche r.lucchetti(a)univpm.it http://www.econ.univpm.it/lucchetti