for this

        Spend <- c(5, 3, 6, 5, 8, 9, 10, 17, 12, 11, 10, 9)
        Income <- c(25, 29, 22, 34, 22, 28, 29, 31, 34, 45, 45, 40)

for lag=0

       cor(Spend,Income)
      [1] 0.34
       ax=as.numeric(acf(Spend,plot=F)[[1]][2])
       ay=as.numeric(acf(Income,plot=F)[[1]][2])
       ax
      0.62
       ay
      0.52

I want to do this for all time series that correspond to all other lags (+-15)

    cc <- acf(cbind(Spend, Income))

how infer this information from the output of cc
the desired output:

    lag         r         ax          ay
     0    0.34011   0.6283999   0.52305
     1
     2
    etc

Khám phá các thẻ bài đăng