Testing for mean differences in time series I've checked the past posts in the forum, but none of them was satisfactory for my problem. I have to divide a time series into sub-intervals, then I have to test for mean differences between these intervals. The problem is that since it is a time series, there is autocorrelation, therefore I cannot use the classical Anova and t-test (or Wilcoxon or others) which require independence. I need a test to make pairwise comparisons (such as the t-test) and one for multiple comparisons (such as the Anova) which don't require Independence (and preferably also for non-normal data and non-constant in variance data). Do you have any suggestion? It must be hypothesis testing not other procedure, thanks for your help.
 A: For pairwise comparison
Define a new variable as the difference between the two original variables. If you can reasonably assume it has stable properties (the data generating process does not change) within the sub-interval, then you do two things:


*

*Run a regression of the new variable on a constant alone and use HAC robust standard errors in a $t$-test of the null hypothesis that the slope coefficient equals zero.
This approach is relatively robust against model misspecification but the drawback is it also has less power to detect differences from zero.

*You could model the new variable with ARMA-GARCH and look at whether the intercept in the ARMA model is significantly different from zero.
This approach is relatively less robust against model misspecification but has more power to detect differences from zero.


If you get the same result from both approaches, it would be encouraging. If the results differ, you might want to inspect this deeper. E.g. if you reject the null hypothesis in the ARMA-GARCH but fail to reject in the HAC appraoch, you may look carefully whether the parametric model is justified and decide on whether to rely on it or to go with the more robust approach.
Both approaches can be implemented with the use of existing packages in R (I believe, sandwich and rugarch).
