Removing NA values from a series in the workfile

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

mectricsdonk
Posts: 29
Joined: Fri Oct 01, 2010 2:51 pm

Removing NA values from a series in the workfile

Postby mectricsdonk » Mon Oct 18, 2010 2:20 pm

Dear dear econometric fanatics :series:

{using Eviews 6}
I was wondering how I could remove the NA values (at irregular and regular dates; bank holidays + weekends) from my financial time series, as I'm not able to estimate a garch model with a discontinuous series.
I went through the help file, saying that I should leave those days out. It unfortunately didn't tell me how to do so in eviews.

kind regards :eviews6:

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

Re: Removing NA values from a series in the workfile

Postby EViews Gareth » Mon Oct 18, 2010 2:36 pm

Proc->Contract Current Page

then set the sample to "if X<>NA" where X is the series with the NAs.
Follow us on Twitter @IHSEViews

mectricsdonk
Posts: 29
Joined: Fri Oct 01, 2010 2:51 pm

Re: Removing NA values from a series in the workfile

Postby mectricsdonk » Mon Oct 18, 2010 2:50 pm

Thank you very much :mrgreen:

theolvs
Posts: 3
Joined: Wed Nov 25, 2009 3:49 am

Re: Removing NA values from a series in the workfile

Postby theolvs » Wed Dec 08, 2010 1:02 pm

hello guys! i have a problem.
i want to count how many times some values from the rows of a matrix are over a threshold that i set (its standard deviation). the problem is that i have na values in the matrix and so eviews5 gives me this error message "NA found in matrix in IF VK>VKK then"

the program is:
smpl @all
series yt
group g1

'for !j=1 to 189
'g1.add dser{!j}_sa
'next

sample s0 1989m2 2010m10
stomna(ainflsa,m_ainflsa,s0)

vector(261) v_stdev
for !i=1 to 261
vector v{!i}=@rowextract(m_ainflsa, !i)
v_stdev(!i)=@stdev( @transpose(v{!i}) )
next
mtos(v_stdev,s_stdev,s0)
'delete m_ainflsa v_stdev

smpl @all

series yt=0

for !j=1 to 261
smpl @first+!j @first+!j
!k=0

for !i=1 to 189
vector(1) vk=@abs(m_ainflsa(!j,!i))
vector(1) vkk=v_stdev(!j)


if vk>vkk then
!k=!k+1
endif
next
yt=!k

next


can you help me?how can i omit the na values from this process?

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

Removing NA values from a series in the workfile

Postby EViews Gareth » Wed Dec 08, 2010 1:13 pm

Check whether the values are NAs first :D
Follow us on Twitter @IHSEViews

theolvs
Posts: 3
Joined: Wed Nov 25, 2009 3:49 am

Re: Removing NA values from a series in the workfile

Postby theolvs » Wed Dec 08, 2010 4:03 pm

yes they are..and NAs are a lot.

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

Re: Removing NA values from a series in the workfile

Postby EViews Gareth » Wed Dec 08, 2010 4:10 pm

I think you misunderstood my statement.

Currently you have:

Code: Select all

if vk > vkk then


I'm saying you should do this:

Code: Select all

if vk<>na and vkk<>na then
    if vk > vkk then
Follow us on Twitter @IHSEViews

theolvs
Posts: 3
Joined: Wed Nov 25, 2009 3:49 am

Re: Removing NA values from a series in the workfile

Postby theolvs » Thu Dec 09, 2010 2:18 am

thanks a lot my friend!!indeed i misunderstood your statement before... i ll test the command you gave me today and i ll report back!! :D

mwu888
Posts: 25
Joined: Sat Jul 09, 2011 5:49 pm

Re: Removing NA values from a series in the workfile

Postby mwu888 » Tue Aug 16, 2011 1:33 pm

How does one remove NAs in a data series in Eviews 7.2?

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

Removing NA values from a series in the workfile

Postby EViews Gareth » Tue Aug 16, 2011 1:54 pm

Could you define what you mean by that?

Do you want to remove them from the workfile? From the sample? Or map them into different values?
Follow us on Twitter @IHSEViews

mwu888
Posts: 25
Joined: Sat Jul 09, 2011 5:49 pm

Re: Removing NA values from a series in the workfile

Postby mwu888 » Wed Aug 17, 2011 5:34 am

I want to remove the NAs in the series I imported from Excel. Can I create a new series that excludes the NAs? How is this done in Eviews 7.2?

EViews Glenn
EViews Developer
Posts: 2671
Joined: Wed Oct 15, 2008 9:17 am

Re: Removing NA values from a series in the workfile

Postby EViews Glenn » Mon Aug 29, 2011 4:42 pm

You can always avoid using observations with NA in them by letting EViews handle them, or if necessary, setting a sample condition. Generally, you shouldn't need to "remove" observations permanently. If I'm understanding correctly, that is what you want to do. In that case, you can do a workfile extract.

From the workfile window, Proc/Copy Extract from Current Page (you can answer the resulting prompt by choosing to do either by link or value), and specify the condtion that your series isn't NA as in

Code: Select all

@all if y<>na

which will remove all observations where Y=NA. Note that this will shorten ALL of the series copied or linked into the new page. You can't have series of unequal lengths in a workfile.

Walio
Posts: 1
Joined: Fri Sep 23, 2011 5:13 pm

Re: Removing NA values from a series in the workfile

Postby Walio » Sat Sep 24, 2011 12:31 pm

And how to map the NAs into different values?
_______________
iphone application development
Last edited by Walio on Fri Oct 21, 2011 7:12 am, edited 1 time in total.

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

Re: Removing NA values from a series in the workfile

Postby startz » Sat Sep 24, 2011 1:47 pm

series y =@recode(x=na,2.71828,x)

deepaib
Posts: 7
Joined: Tue Mar 13, 2012 9:38 pm

Re: Removing NA values from a series in the workfile

Postby deepaib » Thu Mar 15, 2012 9:59 am

Hi,

It is suggested to use condition @all if y<>na to avoid obs with NA. I have 50 series to be contracted that way. Is it possible to do all at once by condition or by programming.

Thank you.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 9 guests