Function to generate lagged variables in a panel.
lagPanel(idvar, timevar, value)
vector of panel identifiers.
vector of time identifiers.
numeric vector, matrix or data frame containing the variable or variables to be lagged.
Gabriele Rovigatti
lagPanel() accepts panel identifiers, numeric time identifiers and one or more variables to be lagged. It returns a vector for vector input and a matrix for matrix or data-frame input. Observations without a corresponding value at \(t-1\) are returned as NA. The combination of idvar and timevar must uniquely identify observations.