@erecode() with <>"something"

For questions regarding programming in the EViews programming language.

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

leocaza
Posts: 18
Joined: Mon Nov 27, 2017 7:18 am

@erecode() with <>"something"

Postby leocaza » Tue Mar 20, 2018 10:04 am

Hi, there is no example of @erecode() in "eviews help".

could you there me how to do @erecode() on a matrix, to recode everything not equal to "X"

@erecode(Matrix, <>0, NA)

... with series, i woulld do @recode(series<>0,NA, series)

Thank you

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

Re: @erecode() with <>"something"

Postby EViews Gareth » Tue Mar 20, 2018 10:16 am

Example is available in the PDF docs, but here's another:

Code: Select all

wfcreate u 10
matrix(3,3) a
matrix(3,3) b
matrix(3,3) e
nrnd(a)
nrnd(b)
nrnd(e)

matrix res = @erecode(@elt(a,0),b,e)   'res will be equal to "b" whenever a<0, and e otherwise.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 29 guests