Dear Researchers,

I have time series data & I’m running OLS regression on Stata.

I want to de-trend a variable while taking into consideration that the trend is stochastic not linear. This is the code I found while searching but I’m not sure if it treats the trend as stochastic:

reg x time

predict x_detrended, resid

In fact, when I plotted the detrended series (x_detrended) with the time variable (quarter in my case) to see the trend, the extracted trend seems to be linear not stochastic. I’m attaching the graph below.

So, I want to know the command on Stata that detrend the series given a stochastic trend not linear.

I will appreciate your help.

Thank you very much

More Dina Abdelsalam's questions See All
Similar questions and discussions