[R] acf function
Hi, Im new to R so this question is quite fundamental. Im trying to compare some autocorrelations generated by the acf function to some theoretical correlations. How can I have acces to just the autocorrelations, for computation? This is some of my code: acf.data-c(acf(x)) acf.data This is the R output: $acf , , 1 [,1] [1,] 1.0 [2,] 0.746183669 [3,] 0.551217818 [4,] 0.414995408 [5,] 0.313840795 [6,] 0.232915721 [7,] 0.173752145 [8,] 0.130249718 [9,] 0.089901832 [10,] 0.057342951 [11,] 0.030612095 [12,] 0.000951186 [13,] -0.021288467 [14,] -0.042727988 [15,] -0.055278855 [16,] -0.064782705 [17,] -0.067162534 $type [1] correlation $n.used [1] 50 $lag , , 1 [,1] [1,]0 [2,]1 [3,]2 [4,]3 [5,]4 [6,]5 [7,]6 [8,]7 [9,]8 [10,]9 [11,] 10 [12,] 11 [13,] 12 [14,] 13 [15,] 14 [16,] 15 [17,] 16 $series [1] x $snames NULL I need just the $acf values. How do I access them? I would really appreciate any advice. Thankyou. Regards, Andre [[alternative HTML version deleted]] __ 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.
Re: [R] acf function
Hi Andre, try acf.data$acf regards, Theresa andre bedon wrote: Hi, Im new to R so this question is quite fundamental. Im trying to compare some autocorrelations generated by the acf function to some theoretical correlations. How can I have acces to just the autocorrelations, for computation? This is some of my code: acf.data-c(acf(x)) acf.data This is the R output: $acf , , 1 [,1] [1,] 1.0 [2,] 0.746183669 [3,] 0.551217818 [4,] 0.414995408 [5,] 0.313840795 [6,] 0.232915721 [7,] 0.173752145 [8,] 0.130249718 [9,] 0.089901832 [10,] 0.057342951 [11,] 0.030612095 [12,] 0.000951186 [13,] -0.021288467 [14,] -0.042727988 [15,] -0.055278855 [16,] -0.064782705 [17,] -0.067162534 $type [1] correlation $n.used [1] 50 $lag , , 1 [,1] [1,]0 [2,]1 [3,]2 [4,]3 [5,]4 [6,]5 [7,]6 [8,]7 [9,]8 [10,]9 [11,] 10 [12,] 11 [13,] 12 [14,] 13 [15,] 14 [16,] 15 [17,] 16 $series [1] x $snames NULL I need just the $acf values. How do I access them? I would really appreciate any advice. Thankyou. Regards, Andre [[alternative HTML version deleted]] __ 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. __ 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.
[R] acf function
Dear all, I have an annual time-series of population numbers and I would like to estimate the auto-correlation. Can I use acf() function and judge whether auto-correlation is significant by the plots? The acf array, eg: Autocorrelations of series 'x$log.s.r', by lag 0 1 2 3 4 5 6 7 8 9 10 11 12 1.000 0.031 -0.171 -0.451 0.021 0.070 0.238 -0.079 -0.046 0.006 0.188 -0.134 -0.016 13 14 15 -0.153 0.146 0.096 gives the auto-correlation at lags 1, 2 Is that right? Thank you! [[alternative HTML version deleted]] __ 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.
[R] acf function
Dear all, I have an annual time-series of population numbers and I would like to estimate the auto-correlation. Can I use acf() function and judge whether auto-correlation is significant by the plots? The acf array produced by this functions gives the auto-correlation at lags 1, 2 Is that right? Thank you! [[alternative HTML version deleted]] __ 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.
Re: [R] acf function
It should be ok -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Irene Mantzouni Sent: Thursday, May 08, 2008 5:45 PM To: [EMAIL PROTECTED] Subject: [R] acf function Dear all, I have an annual time-series of population numbers and I would like to estimate the auto-correlation. Can I use acf() function and judge whether auto-correlation is significant by the plots? The acf array, eg: Autocorrelations of series 'x$log.s.r', by lag 0 1 2 3 4 5 6 7 8 9 10 11 12 1.000 0.031 -0.171 -0.451 0.021 0.070 0.238 -0.079 -0.046 0.006 0.188 -0.134 -0.016 13 14 15 -0.153 0.146 0.096 gives the auto-correlation at lags 1, 2 Is that right? Thank you! [[alternative HTML version deleted]] __ 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. __ 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.