Lags (or leads) a variable in a time-series corss-sectional dataset.
tscslag(dat, x, id, time, lagLength = 1)
A data frame.
A string identifying variable to be lagged.
A string identifying the name of the cross-sectional identifier.
A string identifying the name of the time variable.
The length of the lag, use negative values for leading variables.
A vector giving the lagged values of x
.