cor.lag {YRmisc}R Documentation

Lag/Lead Correlation

Description

Calculating correlation of two vectors with lag and lead periods. The correlations are used to determine the lag or lead effect between two variables. The correlation function uses "na.or.complete" method and calculate the Pearson's correlation.

Usage

cor.lag(x,y,lag,lead)

Arguments

x

:the moving vector

y

:the fixed vector

lag

:number of lag periods

lead

:number of lead periods

Examples

cor.lag(mtcars[,1],mtcars[,2],3,3)

[Package YRmisc version 0.1.6 Index]