Hi Megan, Answer for you third question. This function will return the maximum CCF value along with corresponding lag value. Input to this function are a and b which are nothing but two time series.
Find_Max_CCF<- function(a,b) { d <- ccf(a, b, plot = FALSE) cor = d$acf[,,1] lag = d$lag[,,1] res = data.frame(cor,lag) res_max = res[which.max(res$cor),] return(res_max) } -- View this message in context: http://r.789695.n4.nabble.com/ccf-function-tp2288257p2288336.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.