# Mann-Kendall test Stata

I am new in this forum.

I am beginning to work with time series, I have a daily (25,000+ observations) temperature dataset (01/01/1946 - 07/01/2014)

I want to test for the following:

1. Trends: So far I used OLS, but I have heard about using Mann-Kendall test may be useful.
2. seasonality: In the same way that in the previous point so far I tried to analyze them with OLS, any recommendation is very welcome.
3. structural breaks: the problem with this aspect is that graphically it cannot be observed any breaks, therefore I have been trying with CUSUM and CUSUMSQ to identify this structural breaks, some additional recommendations?

As additional point I need to perform this on Stata. I saw in the web about Kendall package for R, but I cannot use R. Currently I use Gretl and Stata, I hope someone might help me.

• What are you trying to achieve? How are you analyzing seasonality via OLS? Jul 20, 2014 at 23:58
• I am trying to get measure trend and seasonality (in case they exists), in order to get the inputs for later estimating weather risks. Regarding the seasonality I have been using monthly dummies and adding these monthly dummies into the OLS model (being careful with collinearity, of course) Jul 21, 2014 at 2:35
• I think Mann-Kendall can be useful for detecting the existence of trend, but in order to estimate it, you may want something a little more sophisticated. A good place to start might be here, or with the Foreacsting book by Makridakis, Wheelwright and Hyndman. Jul 21, 2014 at 2:57
• Perfect!, thanks a lot for your help! It really helps. Jul 24, 2014 at 4:08

2. Seasonality: Of course there are many ways including the popular X13 seasonal adjustment procedure, but as an easy start I would suggest to add seasonal dummies to your model. Given your daily data, perhaps use monthly dummies. Since the data sampling (daily) is not equal to the wanted seasonal dummy periodicity (monthly) I think you cannot use the built-in seasonals() function (nor the menus) for that. Instead to create for example a dummy for observations in January in Gretl you could do series M1 = ($obsminor == 1), because$obsminor gives you the monthly information here.
• Thanks to Jack Lucchetti for reminding me of the dummify() function! I guess instead of $obsminor == 1 (which only holds ones and zeros) it would have to be just $obsminor in the first step, which would contain values from 1 through 12 in this case. After the series is created, you can mark it as discrete (right-click, edit attributes, treat as discrete), and then you can choose "Add/Dummies for discrete series" from the menu to get the same result as from the dummify() function. Jun 11, 2017 at 13:23