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 will be spurious and unusable. E.g. the value assigned to x1_1 for observation 2.1 is not the first lag of x1 at all, but rather the last observation of x1 for unit 1.
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. Here are illustrative commands, assuming the unit data blocks each contain 30 observations and we want to drop the first row of each:
(* create index variable *) genr index (* create dum = 0 for every 30th obs *) genr dum = ((index-1)%30) > 0 (* sample based on this dummy *) smpl -o dum (* recreate the obs. structure, for 56 units *) setobs 29 1.01 56.29
You can now 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).