Learn R Programming

dynamac (version 0.1.12)

ldshift: Take the lagged first difference of a series

Description

Take the lagged first difference of a series

Usage

ldshift(x, l)

Value

the lagged differenced series

Arguments

x

a series to be differenced

l

the number of lags

Author

Soren Jordan and Andrew Q. Philips

Details

ldshift assumes that the series are ordered, that there is no missing data, and that the time intervals are even

Examples

Run this code
x.var <- runif(50)
ld.1.x.var <- ldshift(x.var, 1)
ld.2.x.var <- ldshift(x.var, 2)
head(x.var)
head(ld.1.x.var)
head(ld.2.x.var)

Run the code above in your browser using DataLab