# Detrended line still has a trend

I have a line and I have detrended it but it seems to still have a trend. Visually it has one (see jpg) and it has a unit root (Dickey-Fuller) and fails the Durbin-Watson test, so it is not stationary. The line that I am calling 'detrended' is a plot of the residuals (errors) of a regression of the data on time. My question is why would a supposedly detrended line still have a trend?

It would still have a trend if you have not properly detrended it. Trends are a complicated thing, and you may want to re-visit the model you are using to describe the trend.

First of all, if you're using a linear model, it is almost certainly wrong. You can clearly see a unit root, where the shock in September '06 propagates through time. The series does not revert to the mean. I would say this series is begging for a first-order differencing. That might give you a stationary series you can use for more traditional regression analysis. If that simple fix doesn't work, try an ARIMA model. If you don't know what that is, ask!

If I may ask, what is the goal of this analysis? Could you provide some example data that we might use to help you find a proper model?

• Hi Zach. I have done a first-order differencing and the result is stationary, can be used in traditional regression analysis and it is fine. My question here is about a detrended line. I detrended the line by a) regressing against time using excel b) plotting the residuals. Is it the case that the residuals of a nonstationary line regressed against time in excel are themselves nonstationary? – paul Jul 30 '11 at 21:58
• @paul: You have a non-stationary process here. De-trending through a linear regression vs. time is NOT going to work. – Zach Jul 30 '11 at 22:52
• @Zach: In this case that is (probably) true, but not always. Consider the model $y_t = \beta t + \epsilon_t$ where $\epsilon_t$ is a stationary process. – cardinal Jul 31 '11 at 1:19
• @cardinal: thanks educating me. I guess what I really mean is "look at the chart: linear de-trending isn't going to work." – Zach Jul 31 '11 at 1:42
• @cardinal. I did the D-W test on the residuals and it shows autocorrelation so, in this case at least, ϵt in yt=βt+ϵt appears to be a nonstationary process. – paul Jul 31 '11 at 6:30

At a more basic level aren't you assuming that the original graph has two parts that have the same slope but different intercepts, so if you throw a linear regression through it, the regression line should share that slope and split the difference in intercepts?

This isn't true. Try using the points

x=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) and
y=(1, 2, 3, 4, 5, 16, 17, 18, 19, 20).


The two halves share the same slope (i.e. 1), but a regression through them will not share that slope (it has slope 2.515). The residuals will have a slope (trend) that is the difference between their actual slopes (which may not be the same for each half of your data) and the linear regression's slope.