Learn R Programming

PMmisc (version 0.1.0)

flagcor: 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 corelattion function uses "na.or.complete" method and calculate the pearson's correlation.

Usage

flagcor(x,y,lag,lead)

Arguments

x

:the moving vector

y

:the fixed vector

lag

:number of lag periods

lead

:number of lead periods

Examples

Run this code
# NOT RUN {
flagcor(mtcars[,1],mtcars[,2],3,3)
# }

Run the code above in your browser using DataLab