Page 1 of 1

Help in using @recode and @nan for matrix

Posted: Mon Mar 19, 2018 9:26 am
by sudesh
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

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

Posted: Mon Mar 19, 2018 9:43 am
by EViews Gareth
@erecode