how to detrend a series?
how to detrend a series?
Dear Tom,
I want see the deviation from trend of my interested series, RRG. Thus, I want to detrend it first. My code is written as:
linreg rrg 1968:5 2014:12
# constant t
But I got error: ## SR3. Tried to Use Series Number 39, Only 32 Are Available
It would be good to know any of your suggestions.
Thank you,
J
I want see the deviation from trend of my interested series, RRG. Thus, I want to detrend it first. My code is written as:
linreg rrg 1968:5 2014:12
# constant t
But I got error: ## SR3. Tried to Use Series Number 39, Only 32 Are Available
It would be good to know any of your suggestions.
Thank you,
J
Re: how to detrend a series?
Do
set trend = t
and use TREND (not T) in the regression. T is a reserved variable used as a entry pointer in expressions.
You could also just do FILTER with the option REMOVE=TREND.
set trend = t
and use TREND (not T) in the regression. T is a reserved variable used as a entry pointer in expressions.
You could also just do FILTER with the option REMOVE=TREND.
Re: how to detrend a series?
Thank you for the above comments.TomDoan wrote:Do
set trend = t
and use TREND (not T) in the regression. T is a reserved variable used as a entry pointer in expressions.
You could also just do FILTER with the option REMOVE=TREND.
lingreg rlogg 1968:4 2014:12
# constant trend
set rloggfit %regstart() %regend = %beta(1) + %beta(2)*trend
However, I got the error:
## SX22. Expected Type SERIES[REAL], Got RECTANGULAR[REAL] Instead
>>>>set loggfit <<<<
I wonder why it got "RECTANGULAR[REAL]"?
Re: how to detrend a series?
First, you can just doapplej wrote:Thank you for the above comments.TomDoan wrote:Do
set trend = t
and use TREND (not T) in the regression. T is a reserved variable used as a entry pointer in expressions.
You could also just do FILTER with the option REMOVE=TREND.I did the following and want to get the fitted dependent variable. :
lingreg rlogg 1968:4 2014:12
# constant trend
set rloggfit %regstart() %regend = %beta(1) + %beta(2)*trend
However, I got the error:
## SX22. Expected Type SERIES[REAL], Got RECTANGULAR[REAL] Instead
>>>>set loggfit <<<<
I wonder why it got "RECTANGULAR[REAL]"?
prj rloggfit
to get the fitted values from the regression (any LINREG). The line you're showing as producing an error is different from the one that you showed originally, so I don't know if you use loggfit in some other way.