Dear Eviews experts,
I would like to make a complex condition for the lag of model. Suppose based on SIC criteria, number of lag is "a"
Below is my set of conditions:
if a <3 is true then a=3, else a = a
if a>6 is true then a=6, else a=a
At this moment I am stuck with setting the two conditions by writing 2 separate conditions because a is always either 3 or 6.
Please help me to fix it. Thank you very much!!!!
How to set complex condition in EViews?
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Posts: 15
- Joined: Mon Apr 25, 2011 8:31 pm
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to set complex condition in EViews?
Code: Select all
a = min(max(a, 3), 6)
-
- Posts: 15
- Joined: Mon Apr 25, 2011 8:31 pm
Re: How to set complex condition in EViews?
EViews Glenn wrote:Code: Select all
a = min(max(a, 3), 6)
I am sorry that when I write:
scalar a=min(max(1, 3), 6)
EViews says "Syntax error". Could you pls check that?
Many thanks
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to set complex condition in EViews?
Sorry, use @min and @max.
-
- Posts: 15
- Joined: Mon Apr 25, 2011 8:31 pm
Re: How to set complex condition in EViews?
EViews Glenn wrote:Sorry, use @min and @max.
Sorry again, EViews said "too many arguments" even if I choose only scalar a=@min(3,6) for instance.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to set complex condition in EViews?
Try
Code: Select all
a = (a<3)*3 +(a>=3)*a
a = (a>6)*6 + (a<=6)*a
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to set complex condition in EViews?
Sorry, I'm thinking in different programming language syntax. To do Startz's excellent suggestion in one line
Code: Select all
a = (a<3)*3 + (a>6)*6 + (a>=3 and a<=6)*a
Who is online
Users browsing this forum: No registered users and 20 guests