powered by
Take the lag of a variable using the specified number of lag(s).
lagm(x, k)
dimentional matrix with k
a matrix object
number of lags
x <- cbind(x1 = c(23, 45, 56, 78, 98, 21, 17), x2 = c(3, 4, 6, 7, 2, 9, 17)) lagm(x, k = 3)
Run the code above in your browser using DataLab