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 :)
How to use IF command
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
How to use IF command
- Attachments
-
- a2data_id1_2.wf1
- (116.01 KiB) Downloaded 318 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to use IF command
You need to use a sample.
Code: Select all
smpl if x>7
Re: How to use IF command
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!
Thanks!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to use IF command
That's exactly what you have done.
Re: How to use IF command
But when I open up "distance" it still shows me all 1000 observations? I can't see the 221 restricted observations.That's exactly what you have done.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to use IF command
Hit the SMPL +/- button.
Re: How to use IF command
Thank you! exactly what I was looking for :)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to use IF command
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
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?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to use IF command
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.
Who is online
Users browsing this forum: No registered users and 2 guests
