Help in using @recode and @nan for matrix

For questions regarding programming in the EViews programming language.

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

sudesh
Posts: 51
Joined: Fri Nov 03, 2017 7:30 pm

Help in using @recode and @nan for matrix

Postby sudesh » Mon Mar 19, 2018 9:26 am

Hi,

I have been using this code to find the maximum length, minimum or average length of a period.

However, instead of using series, I would like to use matrix to generate signal.

Can anyone know how to convert this code for matrix.


if @isobject("signal_"+%a+"_"+%s+"_"+%y+"_"+%x+"_"+%i)=1 then
SMPL IF signal_{%a}_{%s}_{%y}_{%x}_{%i} > 0
series tmplong_{%a}_{%s}_{%y}_{%x}_{%i} =1
tmplong_{%a}_{%s}_{%y}_{%x}_{%i} = @recode( tmplong_{%a}_{%s}_{%y}_{%x}_{%i}>0, @nan(tmplong_{%a}_{%s}_{%y}_{%x}_{%i}(-1),0 )+1,tmplong_{%a}_{%s}_{%y}_{%x}_{%i})
tmplong_{%a}_{%s}_{%y}_{%x}_{%i} = @recode( tmplong_{%a}_{%s}_{%y}_{%x}_{%i}>0 and @nan(tmplong_{%a}_{%s}_{%y}_{%x}_{%i}(1),0 )>0,0,tmplong_{%a}_{%s}_{%y}_{%x}_{%i})
endif

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

Re: Help in using @recode and @nan for matrix

Postby EViews Gareth » Mon Mar 19, 2018 9:43 am

@erecode
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 35 guests