Removing NA values from a series in the workfile
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Posts: 29
- Joined: Fri Oct 01, 2010 2:51 pm
Removing NA values from a series in the workfile
Dear dear econometric fanatics
{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
{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
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Removing NA values from a series in the workfile
Proc->Contract Current Page
then set the sample to "if X<>NA" where X is the series with the NAs.
then set the sample to "if X<>NA" where X is the series with the NAs.
Follow us on Twitter @IHSEViews
-
- Posts: 29
- Joined: Fri Oct 01, 2010 2:51 pm
Re: Removing NA values from a series in the workfile
Thank you very much
Re: Removing NA values from a series in the workfile
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?
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?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Removing NA values from a series in the workfile
Check whether the values are NAs first
Follow us on Twitter @IHSEViews
Re: Removing NA values from a series in the workfile
yes they are..and NAs are a lot.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Removing NA values from a series in the workfile
I think you misunderstood my statement.
Currently you have:
I'm saying you should do this:
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
Re: Removing NA values from a series in the workfile
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!!
Re: Removing NA values from a series in the workfile
How does one remove NAs in a data series in Eviews 7.2?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Removing NA values from a series in the workfile
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?
Do you want to remove them from the workfile? From the sample? Or map them into different values?
Follow us on Twitter @IHSEViews
Re: Removing NA values from a series in the workfile
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 Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: Removing NA values from a series in the workfile
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
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.
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.
Re: Removing NA values from a series in the workfile
Last edited by Walio on Fri Oct 21, 2011 7:12 am, edited 1 time in total.
-
- 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
series y =@recode(x=na,2.71828,x)
Re: Removing NA values from a series in the workfile
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.
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.
Who is online
Users browsing this forum: No registered users and 29 guests