Learn R Programming

Eplot (version 1.0)

lagmat: lagmat

Description

Creates a lagged matrix with the desired number of lags.

Usage

lagmat(x, lags)

Arguments

x
the series to be lagged
lags
number of lags desired

Value

matrix with dimension [NROW(x),length(lags)]

Examples

Run this code
x = rnorm(100)
lx <- lagmat(x,2)
tail(lx)
tail(x)

Run the code above in your browser using DataLab