Gretl Manual: Gnu Regression, Econometrics and Time-series Library | ||
---|---|---|
Prev | Chapter 8. Loop constructs | Next |
The third form of loop construct offered in gretl is an indexed loop, using the internal variable i. You specify starting and ending values for i, which is incremented by one each time round the loop. The syntax looks like this: loop i=1..20. Example 8-3 shows one use of this construct. We have a panel data set, with observations on a number of hospitals for the years 1991 to 2000. We restrict the sample to each of these years in turn and print cross-sectional summary statistics for variables 1 through 4.