[Gretl-users] indexes in loops
Allin Cottrell
cottrell at wfu.edu
Thu Sep 7 10:15:02 EDT 2006
On Thu, 7 Sep 2006, Ignacio Díaz-Emparanza wrote:
> Looking at Jack's script gmmstart.inp, published recently in
> this list (I attach the file) may be the solution is to write
> a previous line "j = i+1" and use the index j (but I have no
> very clear whether j is now an scalar or an integer as "i")
>
>> loop i=2..11 --quiet
>> j = i - 1
>> matrix tmp[,$i] = (X[,j] - X[,11]) .* elmrs
>> end loop
>
> I suspect that "j = i -1" is an alias of "scalar j = i - 1",
> Do we have a command as "integer j = i - 1"?
At present, no. But I think this should be introduced soon: the
ability to define a variable as having integer type. (Right now
all scalars are floating-point numbers.)
Allin.
More information about the Gretl-users
mailing list