1

Is there a way to change the x-axis on an acf and pacf graph so that it starts at 1 and not at 0?

here is an example graph:

N<-c(34913.60,  25555.69,  33132.19,  40212.03,  21973.67,  28005.34,30182.27,  69070.89,  46548.21, 57806.81 , 49925.19, 116612.29,71234.68,  81274.05,  60790.56, 159475.70,  93121.76,  92812.45,75588.42, 220922.25, 108124.88, 120144.80, 105067.53, 229750.52,101851.80, 177999.71, 112606.36)
N<-ts(N,deltat=1/4,start=c(8,1))
acf(ts(N,frequency=1))
agamesh
  • 559
  • 1
  • 10
  • 26
Summer Gleek
  • 334
  • 5
  • 15
  • May be this link helps http://stats.stackexchange.com/questions/57573/omit-0-lag-order-in-acf-plot – akrun Oct 13 '14 at 13:26

1 Answers1

0

Yes, First you need to remove the default setting that prints the plot. Use

acf_var = acf(ts(N,frequency=1),plot=FALSE)

Now, you need to offset your acf graph by 1 unit, I have generalized the result to any offset, and offset 0 will give the actual acf graph. Note that type='h' is used in plot to make it look like a acf/pacf plot.

lag_x = acf_var$lags
acf_y = acf_var$acf 
offset = 1 
L = length(lag_x)
plot(x=lag_x[1+offset:L],y=acf_y[1+offset:L],type='h')

Note: significance bands can be obtained from a procedure given in this answer

Community
  • 1
  • 1
user101295
  • 11
  • 1