several if statements

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

annaecon
Posts: 1
Joined: Wed Nov 22, 2017 2:56 pm

several if statements

Postby annaecon » Wed Nov 22, 2017 3:41 pm

Hi,
I am trying to create a simple series "of_cus_2_dir" based on if statements on the values of another series "of_cus_2_sum". The "of_cus_2_dir" series should then contain 1, 0 and -1 only. Is this possible without having created the "of_cus_2_dir" series in advance?

wfopen C:\Users\xlianj\Dropbox\OTC\Data\Eviews\sekeur_daily
'wfopen ..\Eviews\SEKEUR
'wfopen SEKEUR_daily

if of_cus_2_sum >0 then of_cus_2_dir =1
and
if of_cus_2_sum =0 then of_cus_2_dir =0
and
if of_cus_2_sum <0 then of_cus_2_dir =-1

endif

What is wrong?

Could I do this drectly in the series window by generate series by equation?

Best,
Anna

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: several if statements

Postby EViews Gareth » Wed Nov 22, 2017 7:40 pm

Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 24 guests