If the time periods are evenly spaced you may want to use lagged values of variables in a panel regression; you may also with to construct first differences of variables of interest.
Once a dataset is properly identified as a panel (as described in the previous section), gretl will handle the generation of such variables correctly. For example the command genr x1_1 = x1(-1) will create a variable that contains the first lag of x1 where available, and the missing value code where the lag is not available.
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 --restrict or --dummy option. 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 10 below).