Hi,
I'm using EViews9.
I want to create a new series varX based on series varY, and keep only values that are below, say, 200.
How can I do that?
Thanks!
Danny
Create new series subject to a condition
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new series subject to a condition
@recode.
Code: Select all
series varx = @recode(vary<200, vary, 0)
Re: Create new series subject to a condition
Hi,
series varx = @recode(vary<200, vary, 0) does not do exactly what I wanted.
The observations must be dropped if the condition is not met.
Thanks!
Danny
series varx = @recode(vary<200, vary, 0) does not do exactly what I wanted.
The observations must be dropped if the condition is not met.
Thanks!
Danny
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Create new series subject to a condition
Code: Select all
series varx = @recode(vary<200, vary, NA)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new series subject to a condition
If Glenn's solution doesn't do what you want, you'll need to define "dropped".
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Create new series subject to a condition
And you can always do
Code: Select all
smpl if vary<200Re: Create new series subject to a condition
Good morning,
Thanks to you all.
Both, smpl if vary<200, and series varx = @recode(vary<200, vary, NA) will be useful for what I need to do.
Thanks again for your time.
Danny
Thanks to you all.
Both, smpl if vary<200, and series varx = @recode(vary<200, vary, NA) will be useful for what I need to do.
Thanks again for your time.
Danny
Who is online
Users browsing this forum: No registered users and 2 guests
