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 Jason, EViews Steve, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new series subject to a condition
Follow us on Twitter @IHSEViews
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 Developer
- Posts: 2672
- 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)
Observations where VARX are NA will be dropped from most procedures.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- 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".
Follow us on Twitter @IHSEViews
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- 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<200
Re: 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 35 guests