Description Usage Arguments Value Examples
A function that correctly lags panel data where units are identified by
id
and time periods are identified with t
. Results are in same
order as data
and are padded with NA
as needed.
1 |
x |
String identifying the vectors to be lagged in |
id |
String identifying the unit (e.g. country) identifier in
|
t |
String identifying the time identifier in |
lag |
Lag order, i.e. by how many time periods should |
data |
A data frame. If not provided, a new one will be constructed with the vectors supplied for the other parameters. |
A vector of same length as x
representing lagged values with
leading NA
's.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.