Try constructing the acf plot using the traditional plot tools. Then
you can do what you like with it. Eg if your model is called
model.lme, then something like this should work:
acf.resid - ACF(model.lme, resType = n)
my.lags - acf.resid$lag 0.5
plot(acf.resid$lag[my.lags],
Try this. It uses Matthias' trick for getting rid of lag 1.
The it defines a new local plot.acf
and then
defines a new local plot.acf which
# test data
set.seed(1)
x - rnorm(1000)
# run acf
x.acf - acf(x)
# remove lag 0 -- see Matthias' post
x.acf$acf[1] - NA
# plot with custom x axis
I need to modify the graph of the autocorrelation. I tried to do it through
plot.acf but with no success.
1. I would like to get rid of the lag zero
2. I would like to have numbers on the x-axis only at lags 12, 24, 36, 48, 60,
...
Could anybody help me in this?
Any help will be appreciated
Hi Stefano,
the manual tells us that we can access components of an acf object
directly by acf.obj[.], but assignment ]- does not work this way.
One way of doing what you want is to assign NA to x$acf[x$lag==0] like so:
x - acf(runif(100))
x$acf[1] - NA
plot(x)
But I suppose what you actually