Re: [R] "ccf versus acf"

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 15 Sep 2006 - 08:54:08 GMT

On Thu, 14 Sep 2006, Werner,Arelia [PYR] wrote:

> I am trying to run a cross-correlation using the "ccf()" function. When
> I select plot = TRUE in the ccf() I get a graph which has ACF on the
> y-axis, which would suggest that these y-values are the auto-correlation
> values.

But cross-correlations are part of the ACF for a bivariate time series, so why do you think that is a problem?

Your example is not reproducible. However, there is a reproducible example on the help page that looks like cross-correlations (look at the value at lag 0). And

> ccf(mdeaths, fdeaths, ylab="ccf")

might be what you are looking for.

> How should I adjust the code to produce a plot that provides the
> cross-correlation values?
>
> Here is my code:
>
> w002dat <- read.csv("w054_1128958_08NM174.csv", header=TRUE)
> w002dat$date <- as.Date(w002dat$date,"%m/%d/%Y")
> attach(w002dat)
> w002ccfhdgw <- ccf((gwneg), (hydro), lag.max = 400, type =
> c("correlation"),
> plot = TRUE, na.action = na.exclude)
>
> Thank you
>
> Arelia
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.

PLEASE do!

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Fri Sep 15 18:57:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 15 Sep 2006 - 09:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.