cv.lag {YRmisc}R Documentation

Create a lag variable

Description

Create a lag variable, with a choice of lag periods. The lag variable can be used to test lag effects between variables.

Usage

cv.lag(x,n)

Arguments

x

:a vector

n

:number of lag periods

Examples

cv.lag(mtcars[,2],3)
data.frame(mtcars,cv.lag(mtcars[,3], 1))

[Package YRmisc version 0.1.6 Index]