[R] autocorrelation of a series

efthimiosm efthimiosm at bii.a-star.edu.sg
Mon Jun 18 13:34:45 CEST 2012


Hello all,

I have a general question about time series and I wonder if someone 
could help me. I have time series data of this form:

x=c(rnorm(500,0,1),rnorm(500,5,1),rnorm(500,10,1),rnorm(500,3,1),rnorm(500,8,1),rnorm(500,4,1),rnorm(500,1,1),rnorm(500,7,1))
time=1:4000
plot(time,x)

Each "rnorm" generates a different cluster. I would like to do a 
statistical test of mean difference between the first, the second and 
the seventh cluster:

HO: mean(rnorm(500,0,1)) = mean(rnorm(500,5,1)) = mean(rnorm(500,1,1))

My questions are: (a) Can I simply do this by an ANOVA model on these 
values or by change-point analysis (using "multiple.mean.norm" of the 
package "changepoint")? (b) If I want to check for the autocorrelation 
of my series (by "acf"), which data should I use: the residuals of the 
ANOVA model or the actual data? The actual data will give me high 
autocorrelation due to the trend, is that correct?

Thank you for your help,
Mike



More information about the R-help mailing list