is a much safer way to do this, as the time-series operators will
catch any issues with the time index (what if period 4 was not
recorded for a given firm?). It requires that the data be -xtset- or -
tsset-, and doing so will also catch some miscoding if the time index.
Best to have Stata look for such mistakes in the process of data
transformation. Very misleading results can be produced if you use
explicit subscripts and the observation is completely missing (not
Stata missing, but not recorded at all).