Page 1 of 1
How to use IF command
Posted: Fri Aug 31, 2012 3:30 am
by truetears
Hi guys, I want to know how I can use the IF command to restrict the data group to only specific values, what I mean is, in the file attached, in the "distance" group, I want to restrict the spreadsheet so that it only shows values for which distance>7403.77, how do I do this?
Thanks :)
Re: How to use IF command
Posted: Fri Aug 31, 2012 6:31 am
by EViews Gareth
You need to use a sample.
Re: How to use IF command
Posted: Fri Aug 31, 2012 8:05 am
by truetears
Sorry I am quite new to Eviews 7, what exactly does that mean? I have clicked on window and enter in "distance > 7403.77" in the IF space, then it comes up with the number of observations which satisfies the IF condition, however I wish to actually restrict the spreadsheet of the group "distance" such that only the observations that are greater than 7403.77 are shown rather than the whole spreadsheet.
Thanks!
Re: How to use IF command
Posted: Fri Aug 31, 2012 8:13 am
by EViews Gareth
That's exactly what you have done.
Re: How to use IF command
Posted: Fri Aug 31, 2012 8:32 am
by truetears
That's exactly what you have done.
But when I open up "distance" it still shows me all 1000 observations? I can't see the 221 restricted observations.
Re: How to use IF command
Posted: Fri Aug 31, 2012 8:55 am
by EViews Gareth
Hit the SMPL +/- button.
Re: How to use IF command
Posted: Fri Aug 31, 2012 9:23 am
by truetears
Thank you! exactly what I was looking for :)
Re: How to use IF command
Posted: Fri Aug 31, 2012 9:25 am
by EViews Gareth
Note that hitting the SMPL+/- button only changes the view you are currently looking at. The current sample is applied to any statistics you perform, whether or not you have hit that button.
Re: How to use IF command
Posted: Fri Aug 31, 2012 10:58 am
by truetears
Ahh I see, thanks for that, just out of curiosity then, how would I be able to use only the restricted sample in regression analysis?
Re: How to use IF command
Posted: Fri Aug 31, 2012 11:14 am
by EViews Gareth
By default it will use the restricted sample - as I said, once you have set the restricted sample it generally gets used for everything you do after that.