If the time periods are evenly spaced you may want to use lagged values of variables in a panel regression. In this case arranging the data rows by unit (stacked time-series) is definitely preferable.
Suppose you create a lag of variablex1, using genr x1_1 = x1(-1). The values of this variable will be mostly correct, but at the boundaries of the unit data blocks they are not unusable: the "previous" value is not actually the first lag of x1_1 but rather the last observation of x1 for the previous cross-sectional unit. Such values are marked as missing by gretl.
If a lag of this sort is to be included in a regression you must ensure that the first observation from each unit block is dropped. One way to achieve this is to use Weighted Least Squares (wls) using an appropriate dummy variable as weight. This dummy (call it lagdum) should have value 0 for the observations to be dropped, 1 otherwise. In other words, it is complementary to a dummy variable for period 1. Thus if you have already issued the command genr dummy you can now do genr lagdum = 1 - dummy_1. If you have used genr paneldum you would now say genr lagdum = 1 - dt_1. Either way, you can now do
wls lagdum y const x1_1 ...
to get a pooled regression using the first lag of x1, dropping all observations from period 1.
Another option is to use the smpl with the -o flag and a suitable dummy variable. Example 5-2 shows illustrative commands, assuming the unit data blocks each contain 30 observations and we want to drop the first row of each. You can then run regressions on the restricted data set without having to use the wls command. If you plan to reuse the restricted data set you may wish to save it using the store command (see Chapter 9 below).