Sample Restriction

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Sample Restriction

Postby diggetybo » Sat Feb 21, 2015 12:01 pm

I looked through the tutorials and older posts, couldn't find what I was looking for. If this question was addressed though, do post the link. If not I'll bring it up in this post:

How can we impose a sample restriction such that after a regression eviews excludes all cases where the residual was greater than a certain value, say: .35?

The premise is, the subsequent regression would not include those values.

On a similar note, for the general case, could we perform this operation with standard residuals? If it's not too much trouble, provide a sample code for that as well, to address outliers using the aforementioned high standard residual exclusion.

Can this restriction be performed across all variables with the right statement, or do we have to add a statement to the sample for every series?

Please advise,

Thank you for reading

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Sample Restriction

Postby EViews Gareth » Sat Feb 21, 2015 1:15 pm

I'm not 100% I follow.

You want to estimate two regressions? The first one on a full sample, then the second one dependent upon the residuals of the first?

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Sample Restriction

Postby diggetybo » Sat Feb 21, 2015 1:35 pm

Yes, what I meant was regression diagnostics for excluding outliers, let me elaborate:

1) Regress the equation and save residuals

2) Graph a scatter plot of residuals vs fitted values, examine cases of high positive and high negative outliers, in my case, lets say a resid value of: plus or minus .35

3) Instead of restricting the entire sample, I wanted to run another regression, this time using using the knowledge we got from the graph as criteria to eliminate possible unwanted influence.

so part 3) is where I was lost, when I'm at the if clause as I'm running the regression the 2nd time around, what restriction should I put to limit the sample to include only observations such that the resid is within the plus or minus .35 range? So I was curious if this had to be done series by series, or could it be done all at once?

and I was also curious if this could be done using standardized residuals, and if so, is the code much different?

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

Re: Sample Restriction

Postby startz » Sat Feb 21, 2015 2:55 pm

After the regression you can save the residuals in a series and then use them as you wish in a smpl. Something like

Code: Select all

series e=resid smpl if abs(e)<.35

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Sample Restriction

Postby diggetybo » Sat Feb 21, 2015 3:41 pm

Oh, well that was easier than I thought. Thank you!

On this note of outliers, I'm trying to compute Chauvenet's test or Grubb's Test using Eviews 6. It doesn't seem to have anything like that built in under descriptive statistics.

If you are familiar with this, could you point me towards the most painless way to attempt that?

Thanks again


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests