Lagged residuals

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

pepareja
Posts: 4
Joined: Sun Jul 24, 2011 3:41 am

Lagged residuals

Postby pepareja » Sun Jul 24, 2011 3:50 am

EViews 6
Hello,
I would like to obtain a scatter plot of current OLS residuals against residuals lagged one period. I do have the current residuals saved from OLS regression. How do I create a lagged residual please? Do I need to estimate first the AR(1) model?

Thank you.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Lagged residuals

Postby startz » Sun Jul 24, 2011 7:58 am

if the residuals are in a variable named "e," then the lagged residuals are "e(-1)."

pepareja
Posts: 4
Joined: Sun Jul 24, 2011 3:41 am

Re: Lagged residuals

Postby pepareja » Tue Jul 26, 2011 7:20 am

Hi, thank you for reply. Yes that's what I thought but I am getting a syntax error message.
I am new to EViews so could you maybe guide me step by step? I uploaded the data, estimated OLS equation and thus have series resid created. I believe I need to save it first (not sure how) and lets say I name it e. How do I create e(-1) ... lagged residuals? I tried by estimate by equation, generate series etc but had no success.
Thanks a lot.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Lagged residuals

Postby startz » Tue Jul 26, 2011 7:51 am

After a regression, EViews automatically stores the residuals in a series named resid. So to run a regression, save the residuals, and regress residuals on lagged residuals you could go

Code: Select all

ls y c x series e=resid ls e e(-1)

pepareja
Posts: 4
Joined: Sun Jul 24, 2011 3:41 am

Re: Lagged residuals

Postby pepareja » Wed Jul 27, 2011 7:43 am

Thank you very much, I think I managed now. I still have a query though as you can see in my attachment.
There is an obvious autocorrelation when residuals are lagged against each other however when OLS resid is plotted against time - I don't see any correlation at all. I think I am doing something wrong.
Attachments
residuals.WF1
(22.59 KiB) Downloaded 665 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Lagged residuals

Postby startz » Wed Jul 27, 2011 7:56 am

Make a plot connecting the dots. Note that there tend to be long runs of either positive or negative residuals.

pepareja
Posts: 4
Joined: Sun Jul 24, 2011 3:41 am

Re: Lagged residuals

Postby pepareja » Wed Jul 27, 2011 8:15 am

I don't really know how to connect the dots in the plot. I usually do it with the scatter graph 'fit regression line' however on this one there is no such option...
Do you think there is autocorrelation then as I cannot really see it.
Thank you so much for your time and patience. :)

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Lagged residuals

Postby startz » Wed Jul 27, 2011 8:32 am

If you've saved the residuals in the series e, then open that series and choose graph from the View menu.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests