Hi everyone,
I want to generate series w(t) with the following conditions:
w(t)=0 if a(t)<0
w(t)=a(t) if 0=<a(t)<=1
w(t)=1 if a(t)>1
Could anyone please help me on this command?
Normally with 2 conditions , I use @recode, but I don't know for 3 conditions.
Generate a series based on 3 conditions
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
- Non-normality and collinearity are NOT problems!
- Posts: 3779
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Generate a series based on 3 conditions
Hi everyone,
I want to generate series w(t) with the following conditions:
w(t)=0 if a(t)<0
w(t)=a(t) if 0=<a(t)<=1
w(t)=1 if a(t)>1
Could anyone please help me on this command?
Normally with 2 conditions , I use @recode, but I don't know for 3 conditions.
Code: Select all
wt = @recode(a<0,0,a)
wt = @recode(a>1,1,wt)
Re: Generate a series based on 3 conditions
Thanks so much!
-
- EViews Developer
- Posts: 2676
- Joined: Wed Oct 15, 2008 9:17 am
Re: Generate a series based on 3 conditions
Note that In this specific case, the @bounds function will do both parts of the bounded assignment:
Code: Select all
series w = @bounds(a, 0, 1)
Who is online
Users browsing this forum: No registered users and 2 guests