Alex Rivera | Logout

Extract numeric value from ACF in R

Asked 2012-02-25T02:19:13.913
8

This is what I am trying to do:

x <- c(1,2,3,3,2,3,4,5,6)

my_acf = acf(x,plot=F)


> my_acf

Autocorrelations of series ‘x’, by lag

     0      1      2      3      4      5      6      7      8 
 1.000  0.497  0.097 -0.047 -0.050 -0.075 -0.231 -0.376 -0.316 

I want to extract only 0.497, the correlation coefficient on the first lag, and I want to have it as a numeric value. How can I do that?

Thank You

r
Edit
Report

1 Answer

1

You can try like this

my_acf$acf
answered 2012-02-25T02:58:03.393

Your Answer