Multiplying Na by zero

For questions regarding programming in the EViews programming language.

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

mvictor96
Posts: 20
Joined: Tue Dec 19, 2017 9:23 am

Multiplying Na by zero

Postby mvictor96 » Mon Jul 23, 2018 7:43 am

Hello

I'm performing an operation where I need NA*0 to equal 0 instead of NA . I've read in eviews 2 this used to be the default. In Eviews 10 do you know of any ways I could make this still work

Thank you

startz
Non-normality and collinearity are NOT problems!
Posts: 3379
Joined: Wed Sep 17, 2008 2:25 pm

Re: Multiplying Na by zero

Postby startz » Mon Jul 23, 2018 7:48 am

One way

Code: Select all

series newVar = @recode(oldvar1=na,0,oldvar1)*@recode(oldvar2=na,0,oldvar2)

or something like that, although that would also give NA*7 = 0 which may not be what you want.

mvictor96
Posts: 20
Joined: Tue Dec 19, 2017 9:23 am

Re: Multiplying Na by zero

Postby mvictor96 » Mon Jul 23, 2018 8:17 am

Thanks for your help but yes at the moment I need solely 0*NA to equal 0


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 8 guests