# Describing trend magnitude or detecting trends

I have time series data. One observation per time period, about 10 observations or so. When describing the data (I am interested in descriptive statistics), I'd like to say that there is either a "trend up", "trend down", or "no trend".

I'd like to have a general algorithm for determining if there is a trend. There should be good citations to support the use of this algorithm. I need to say "I am using technique X" and give a citation. This is an important part of my question. You can easily roll your own — what I need is something that's well established and citable and has a specific name.

"What exactly do we mean by trend?" you might ask. I do not have a clear answer to this. So this question is open to some interpretation. Interpret away.

Here is what I've thought of so far.

Joinpoint. Calculate a bunch of different piecewise regressions. Pick one. Calculate a bunch of different piecewise regressions. Pick one.

This seems like huge overkill. Specialized software. Lots of different regression models. Multiple hypothesis testing. Assumes the trend has a specific functional form — in other words, it's not descriptive. On the plus side, this is citable.

I just need a simple descriptive statistic.

Mann-Kendall test. I could use the Mann-Kendall test, comparing the latest observation to all the previous ones. Find the comparison with the lowest p-value. If $p-value < .05$, say there is a trend from that point on.

Problems. Hypothesis testing. Multiple hypothesis testing — I don't know how to correctly adjust the critical level in this case.

Correlation coefficient. I could just look at $r$ and say that there is a trend if $|r| > a$. I think this would be a bad approach in general, since not all trends are linear.

Effect size. Compare the latest observation with the lowest / highest observation in the series. If the effect size from this comparison is large enough, then I say that there is a trend.

This method is dangerous. It works well if the trend is "well-behaved". But if there is an outlier that is either very high or very low, it might give a bad result.

To fix this, instead of comparing to the highest / lowest observation, you could just compare to the observation $n$ time period ago. Say, latest observation versus the one 10 periods ago. Again, this would work well for "well-behaved" trends, but I could see potential problems here.

Integrate effect size. I think this is an improvement on the above. Compare the latest observation with all the previous ones. Assign a score to each comparison: if the effect size > $a$, score = +1; if the effect size < $-a$, score = -1; otherwise, score = 0. Add up the scores, and do something with that.

I could even vary the absolute value of the scores. When comparing with a recent observation, the absolute value of the score could be high; when comparing with an old observation, it could be low.

Smoothing. Because I have so few data points, I am cautious about smoothing or filters, though I have not looked into it properly.

• This "integrate effect size" idea is similar in concept to Common language effect size en.wikipedia.org/wiki/Effect_size#Common_language_effect_size . – Jessica Apr 22 '15 at 20:29
• Since your objective is description, it is difficult to see why you would be concerned with correcting for multiple hypothesis testing. You can overcome the objection to effect size (it is not robust) by using a robust estimator, such as Theil-Sen. There is such an admixture of competing concerns expressed in this question (which, in itself, is understandable) that one is left wondering what, precisely, you mean by "descriptive statistics." Perhaps you could elaborate on that? – whuber Apr 22 '15 at 22:45
• Thanks @whuber. I looked up Theil-Sen, very interesting. By "descriptive statistics" I mean that I just want to make statements about the data itself. I do not want to be making inferences about future data. – Jessica Apr 23 '15 at 16:07
• If you are an R user, or are willing to try it out, take at look at stl (seasonal decomposition by Loess). This approach might give you some ideas to help you narrow your options. – whuber Apr 23 '15 at 16:17

If you consider a time series $\{X_t\}$, you can always decompose it into a trend, a seasonal component and a (stationary) random noise, that is you can write $X_t = m_t + s_t + Y_t$, where $m_t$ is the trend component, $s_t$ is the seasonal component and $Y_t$ is a stationary series. First, I would suggest to test the stationarity of the observed series. You can use different tests to do so, based for instance on sample correlations. If there is evident deviation from stationarity, you could try to estimate a trend. There are many ways to do it. You've mentioned filtering, but you can also think about polynomial fitting (linear regression of your series using $t, t^2, t^3,\dots$ as explanatory variables) or exponential fitting (linear regression on the log of your observations with $t$ as explanatory variable). Finally, once you've done your trend estimation, test the stationarity of your residuals. If the residuals are not stationary you need some more sophisticated model for your trend.