Page 1 of 1
how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 2:37 am
by Nau2306
Hi
since last week i have started using eviews and this forum has been very helpful to me. My problem is that i have a return series for exchange rates and i have removed the 2.5% lowest and 2.5% highest observations as outliers. However, doing so, I can no longer see the dates attached to the observations in the leftmost column. Instead, its only numbering the observations. Now to consider the day of the week effect, I really need these dates to generate my dummy variables. Can someone please help me?
Thanks.
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 8:03 am
by startz
It's hard to say what happened when you removed observations unless you tell us more specifically what you did.
You might simple use a smpl statement to prevent observations from being processed rather than removing them. That way the dates don't change.
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 10:52 am
by Nau2306
What I did was remove the 2.5% lowest and 2.5% highest observations from the return series. To carry out garch estimation, the sample must be continuous. Thats why I had to remove the outliers which was labelled NA. To remove the outliers, I did the following:
proc => contract current page
and I set the sample to
if X<>NA
where X is the series with the NAs.
it is only after doing this that the dates disappear.
Its from this data that I want to study the week of the day effect, i.e. without the outliers.
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 11:14 am
by EViews Gareth
Which version of EViews? When I do what you suggest, EViews keeps the dates fine:
Code: Select all
create d5 1990 2000
series x=nrnd
smpl if rnd>0.8
x = na
smpl @all
pagecontract if x<>na
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 11:23 am
by Nau2306
sorry... its day of the week effect, not week of the day... :)
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 11:33 am
by startz
You're right that the smpl by itself won't work. You will need to follow Gareth's suggestion. (Which works for me too.)
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 12:04 pm
by Nau2306
i am using eviews6. your codes work fine for me too. I think that my mistake is that i am creating a new series using the following
series outlier1=@recode(returns>@quantile(returns, 0.025) and returns<@quantile(returns, 0.975), returns, na)
instead of creating a sample. However if i create a sample using
smpl if returns>@quantile(returns, 0.025) and returns<@quantile(returns, 0.975)
I cant seem to set the outliers to NA :s
I am attaching my workfile as well. I hope you can help me.
Thanks
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 12:18 pm
by EViews Gareth
I'm on my phone, so can't check your file, but what happens if you simply do:
Code: Select all
Pagecontract if returns>@quantile(returns, 0.025) and returns<@quantile(returns, 0.975)
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 12:22 pm
by Nau2306
Its similar to what I did initially. The dates disappear leaving only the observation number. :(
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 12:59 pm
by EViews Gareth
It may be that we improved the behaviour in EViews 7. I can check with EViews 6 tomorrow when I'm in the office.
In the mean time, it may be that you can get it to put the dates back in, by manually changing the page structure (proc->structure/resize current page), and then saying it is "dated specified by date series", and entering the name of the date series (obsid?)
Re: how to keep the date attached to each observation
Posted: Sun Nov 20, 2011 1:15 pm
by Nau2306
I retried the following code you suggested
Pagecontract if returns>@quantile(returns, 0.025) and returns<@quantile(returns, 0.975)
i dont know what went wrong earlier but it seems to be working now.
Thanks loadsss for your precious time, replying back so soon, especially on a Sunday :)