Hi,
Is there a command to assign an observation the highest of two series?
So for example, suppose:
series a=1
series b=2
Is there then a command of the form
series c=@...(a,b)
which would return c=b, because b is greater than a?
In other languages the command 'max' often seems to do this. However, in EViews @max returns the maximum value within a vector.
Thanks,
Marc
Command to assign the highest of two series
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Command to assign the highest of two series
Code: Select all
Series cc = @recode(a>b,a,b)
Re: Command to assign the highest of two series
Thank you.
What about in more general instances? For example, if I wanted to pull out the largest of a list of values, e.g., something of the form:
Series a=@...(b,c,..,z) that would assign a to be the highest of the values from b-z.
I suppose you could do some sort of nested for loop with the @recode command, but that seems unnecessarily complicated.
What about in more general instances? For example, if I wanted to pull out the largest of a list of values, e.g., something of the form:
Series a=@...(b,c,..,z) that would assign a to be the highest of the values from b-z.
I suppose you could do some sort of nested for loop with the @recode command, but that seems unnecessarily complicated.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Command to assign the highest of two series
Put them in a group and use @rmax
Who is online
Users browsing this forum: No registered users and 2 guests
