powered by
This function lags a set of variables in a matrix, each with a separate index. It is also possible to retain only the last lag order.
lag_mts(X, k, last.only = F)
a matrix whose columns are the original variables and the k-th order lagged variables. Column name suffix ".lx".
numeric matrix whose columns are subject to lagging
vector of lag orders
If TRUE only the k-th order lag will be computed, otherwise all lags from 1 to k
data(ger_macro) lag_mts(X = ger_macro, k = 3, last.only = FALSE)
Run the code above in your browser using DataLab