deleting rows containing NA's from a vector

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

EviewsUser1
Posts: 28
Joined: Thu Aug 28, 2014 8:08 am

deleting rows containing NA's from a vector

Postby EviewsUser1 » Thu Feb 22, 2018 8:29 am

I have a vector that contains NA's. I would like to construct a vector that contains only the rows of the original vector for which there are values. Is there a simple command for that?

EViews Matt
EViews Developer
Posts: 221
Joined: Thu Apr 25, 2013 7:48 pm

Re: deleting rows containing NA's from a vector

Postby EViews Matt » Fri Feb 23, 2018 10:38 am

Hello,

It's not as simple as a single function call, but the following returns a vector with the NA's removed (replacing "v" with the name of your vector).

Code: Select all

v.@droprow(@emult(@eneq(v, v), @ranks(@ones(@rows(v)), "a", "i")))


Return to “Programming”

Who is online

Users browsing this forum: Nahid and 5 guests