On 17.4.2002 16:55 Uhr, Sven Garbade wrote:> I want to recalculate an analysis found in a paper. An empirical time > series (velocities, altogether 241 data values) were cross-correlated > with an invertited cosine function (200 milliseconds duration). > Following the authors the resulting values should offer some advantages: > being independent of gain and peak latency differences between single > trials and preserving the temporal aspect of the modulation. Is there a > function to calculate cross-correlations in R? I think cor() is ot the > right one.You need the function ccf() in library(ts). Cheers Kaspar Pflugshaupt -- Kaspar Pflugshaupt Geobotanisches Institut Zuerichbergstr. 38 CH-8044 Zuerich Tel. ++41 1 632 43 19 Fax ++41 1 632 12 15 mailto:pflugshaupt at geobot.umnw.ethz.ch privat:pflugshaupt at mails.ch http://www.geobot.umnw.ethz.ch -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Despite the name, convolve() computes the cross-correlation function. Do something like: q<-convolve(x,y,conj=TRUE,type="open") Bill -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi all, I want to recalculate an analysis found in a paper. An empirical time series (velocities, altogether 241 data values) were cross-correlated with an invertited cosine function (200 milliseconds duration). Following the authors the resulting values should offer some advantages: being independent of gain and peak latency differences between single trials and preserving the temporal aspect of the modulation. Is there a function to calculate cross-correlations in R? I think cor() is ot the right one. Thanks, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._