# Hypothesis testing for seasonality

i want to make hypothesis test for a data for pH values measured for each month of a year. I want to test whether there is any correlation ie: are the values for month of summer having similar values and like that for months of winter and monsoon. which test is most appropriate for this kind of analysis.

This is the seasonal component.

  Jan        Feb        Mar        Apr        May        Jun        Jul
1 -11.500000  -9.916667   7.333333  26.416667 -18.583333  22.750000   1.083333
2 -11.500000  -9.916667   7.333333  26.416667 -18.583333  22.750000   1.083333
Aug        Sep        Oct        Nov        Dec
1 -10.916667  -3.583333  -2.083333  -3.750000   2.750000
2 -10.916667  -3.583333  -2.083333  -3.750000   2.750000


trend of pH with trend line.

Put a 11 dummies for each month, or 3 dummies for quarters in your model (regression). First, check if any of the dummies are significant. If not, then test that all dummies are zero simultaneously. If the dummies are significant individually or all together, then you have seasonality.

As @RichardHardy noted this will not always work. I'm just suggesting a place to start. You may need to find a better solution taylored for your domain. For instance, in economic data with monthly seasonality X-13 routine from Census Bureau is widely used. It has a ton of diagnostics and not very intuitive to sue at first, but it's very powerful

• I am not sure if such a simple answer is adequate. If the data was white noise plus an additive seasonal component, that would work perfectly. But will it work fine on an ARIMA or ARIMA+GARCH series plus additive seasonality or the like? Or when the seasonality is multiplicative? Obviously, the model for the seasonal component will be inadequate and will cause all kinds of trouble (Davidson & MacKinnon "Econometric Theory and Methods" Ch.13.5, "Estimation and Inference in Econometrics" Ch.19.6-7). But perhaps it could still work if we only care about the presence versus absence of seasonality? Commented Mar 3, 2015 at 14:31
• @RichardHardy, it works in ARIMAX too, where dummies will be part of X (exogenous) variables. I doubt that OP's doing ARIMA though, because there's seasonal ARIMA models for this model. Commented Mar 3, 2015 at 14:34
• The question as I understand it is quite general, how to test for the presence of seasonality if the form of seasonality is not given and a model for the data is not given. Then perhaps one should look at frequency domain techniques? Commented Mar 3, 2015 at 14:36
• @RichardHardy, I gave a place to start. Otherwise, it's a huge topic. For monthly data there's X-13 from Census Bureau, it works very well on economic data, not sure how would it apply to pH readings. If it's something like soil, then I bet it'll work. Commented Mar 3, 2015 at 14:39
• Good. Since you did not write explicitly that this is just a starting point, I thought it will be good to make others aware that the simple solution need not apply universally. I still think that examining the series in the frequency domain could be a better - more universal - starting step (although I cannot prove this and I am no expert). Commented Mar 3, 2015 at 14:41

Here's another suggestions to add to the dummy-variable approach suggested by @Aksakal.

From a signal-processing point of view, we can consider the different components of your series to be produced by several different waves of varying frequency. A classic example would be to express your time series $X_t$ as $$X_t = f(t) + g(t) + \epsilon_t$$

where $f(t)$ is some trend component, $g(t)$ is a seasonal/cyclical component, and $\epsilon_t$ is some perhaps serially-correlated high-frequency term that can be modeled via ARIMA or your favorite time series regression. Since you only observe $X_t$, you need a way to discern these many different components from each other. One way to achieve this would be to consider decomposing the signal into its constituent component frequencies. For example, consider the Wavelet transform discussed in section 5.9 of the Hastie Tibshirani Friedman text. Here's a photographic example from that chapter:

As you can see, decomposing the wave exposes the underlying frequencies that drive what you observe in $X_t$. From here, you may consider checking the ACF/PACF of each component frequency and perhaps even thresholding some of the noise before inverting back to the original signal. If you find that some of the lower frequencies exhibit serial dependence, then you may be able to argue that there is an underlying cyclical component.

Certainly, the graphical nature of this approach is impractical and complicated in higher-dimensions, yet there are certainly tools available to automate or deal with this problem accordingly.

I'm guessing that you're looking at rainfall data, in which case you may find the following paper useful:

http://meteora.ucsd.edu/cap/pdffiles/med_trend_rainfall_longobardi.pdf

If your data is very noisy, you may need more complicated procedures such as periodogram or some of the other things the previous posters mentioned. pH in any aquatic system (rainfall, streams, lakes) is generally not highly variable without human intervention, so I'm thinking that the paper above (a t-test or variation thereof) may at least give you somewhere to start, especially if you are dealing with only a single year of data.