Re: [R] Different Autocorrelation using R and other softwares

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sun, 06 Jul 2008 09:33:05 +0100 (BST)

It is not 'obvious' that SPSS/Minitab/Excel are right -- we quite often see users who wrongly assume that the autocorrelation is the Pearson correlation between a series and its lagged values. The correct definition is given in the reference on the help page for acf.

Please note the footer to this message: you were asked for a reproducible example (and not to send HTML mail). In the absence of such an example we cannot investigate if this is user error (which seems the most plausible explanation.)

On Sun, 6 Jul 2008, Yinny wrote:

> Dear All,
>
> Would like to ask the inconsistency in the autocorrelation from R with
> SPSS/Minitab. I have tried a dataset x with 20 data (1-20) and ask R to give
> the autocorrelation of different lags using the command < acf(x,
> lag.max=100, type = "correlation"), However while SPSS and Minitab give the
> same answers (0.85 for lag1), R gives 0.3688 which is much smaller.
>
> Obviously, the answers from SPSS/Minitab are correct by verifying in
> Excel. Is R using another definition in calculating the traditional
> autocorrelation for a time-series?
>
> Thanks for your attention. Would be very grateful if anyone can help.
>
> Yinny
> School of Mathematics & Statistics
> University of Sydney
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>

-- 
Brian D. Ripley,                  ripley_at_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_at_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.
Received on Sun 06 Jul 2008 - 08:39:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 06 Jul 2008 - 09:31:05 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.

list of date sections of archive