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
IF statement with series' elements
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: IF statement with series' elements
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!
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!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: IF statement with series' elements
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
@recode works pretty well, thanks a lot!
Who is online
Users browsing this forum: No registered users and 2 guests
