Page 1 of 1

Residuals plot from a panel regression

Posted: Wed Feb 18, 2015 9:51 am
by ecardamone
Hi, I hope someone can help me figure out how to read the attached graph I produced in EViews. I have a panel data set with 59 cross sections over a 16 year period.

1) How should I read this graph? Mainly, there is no time axis in the graph, so I am not sure how to interpret it. Are the residuals averaged over the time period? It appears the numbers might be for a particular year, but how can I know that?

2) I am trying to produce a scatter plot of the residuals from a panel regression, where I would have the residuals on one axis and time on another, for a selected set of 10 cross sections (the residuals plot with all 59 cross sections is very difficult to read). Is there a way to do this?

Thanks for help!

Re: Residuals plot from a panel regression

Posted: Wed Feb 18, 2015 11:17 am
by EViews Glenn
How did you produce this graph?

Re: Residuals plot from a panel regression

Posted: Wed Feb 18, 2015 11:37 am
by ecardamone
Good question. I run my regression, then I open the results of the equation estimation. In the equation estimation tool bar (not sure if that is the appropriate language) I click on the 'Resids' tab. Then I right click on the very messy plot of residuals, and select 'Options...', and then under 'Basic graph type' I select 'Scatter'. That gives me the graph in question.

Re: Residuals plot from a panel regression

Posted: Wed Feb 18, 2015 12:24 pm
by EViews Glenn
You are plotting a scatterplot of the residuals on the bottom axis, against the actual dependent variable and the fitted value of the dependent variable on the left-hand axis.

Re: Residuals plot from a panel regression

Posted: Wed Feb 18, 2015 12:32 pm
by EViews Glenn
For what you want to do:

1. From the equation, click on Proc/Make Residual Series... Enter a name. Click on OK to create the series.

2. Go to the command line and set a subsample of the 10 cross-sections you want to look at using the smpl command:

Code: Select all

smpl if @inlist(@crossid, "1 2 5 7 9 12 15")
or some equivalent. You can use your cross-section identifier variable in place of the "@crossid".

3. Open the newly created residual series. Click on View/Graph.... Leave the graph type at Line & Symbol. In the Panel Options in the bottom right select Individual cross-sections. Click on OK.

Re: Residuals plot from a panel regression

Posted: Wed Feb 25, 2015 6:47 am
by ecardamone
Thanks so much for help!

I need a little more help. My cross-section identifier for each cross-section contains two words - actually, it's a combination of numbers and words with a space between. For example, I have a cross-section identifier "111A Agriculture" and
"318 Semiconductor". How do I use these identifiers in the code below so that EViews recognizes "111A Agriculture" as a cross-section identifier ? The problem is the space within each identifier. I hope this makes sense.

Thanks again!

Code: Select all

smpl if @inlist(@crossid, "1 2 5 7 9 12 15")

Re: Residuals plot from a panel regression

Posted: Thu Feb 26, 2015 12:49 pm
by EViews Glenn
I'm not sure but I don't think it's easy in the @inlist function.

If I were you, I'd just create a new series with the values of the cross-section identifiers appropriately modified and work with that. Something like

Code: Select all

alpha g = @replace(a, " ", "_")
where A was the original identifier series will give you "_" instead of the spaces.

Re: Residuals plot from a panel regression

Posted: Fri Feb 27, 2015 7:38 am
by ecardamone
Oh great. Thank you! I was thinking along those lines, but I wasn't sure how to do it. This is awesome. Thanks, again!