Page 1 of 1

IF statement with series' elements

Posted: Tue May 08, 2012 1:09 am
by recoba20
Hello,
I have a question about "if statement". When I write the following program (see below), Eviews compare the series and not each element of the series. Do you know how should I modify the program to achieve what I want? Thanks a lot!


series test1
test1= variable1 + variable1bis

series test2
test2 = variable2

series test3
if test1 > test2 then
test3 = test1
else test3 = test2
endif

Re: IF statement with series' elements

Posted: Tue May 08, 2012 6:26 am
by EViews Gareth

Re: IF statement with series' elements

Posted: Tue May 08, 2012 6:39 am
by recoba20
I have checked the link but what I want to do is different

actually I want to generate a serie C which is composed with the maximum of either serie A or serie B as shown below

serie A is
1
65

serie B is
200
2

I would like to automatically generate serie C
200
65

my series A and B have 7000 lines, that is why I want to make it automatically.

Hope you can help me, thanks a lot!

Re: IF statement with series' elements

Posted: Tue May 08, 2012 7:45 am
by EViews Gareth
You can use the information in that link to do that. Either with a smpl statement, or with a recode.

Re: IF statement with series' elements

Posted: Wed May 09, 2012 11:47 pm
by recoba20
@recode works pretty well, thanks a lot!