how to keep the date attached to each observation

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

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

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

how to keep the date attached to each observation

Postby Nau2306 » Sun Nov 20, 2011 2:37 am

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.

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

Re: how to keep the date attached to each observation

Postby startz » Sun Nov 20, 2011 8:03 am

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.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: how to keep the date attached to each observation

Postby Nau2306 » Sun Nov 20, 2011 10:52 am

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.

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

Re: how to keep the date attached to each observation

Postby EViews Gareth » Sun Nov 20, 2011 11:14 am

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

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: how to keep the date attached to each observation

Postby Nau2306 » Sun Nov 20, 2011 11:23 am

sorry... its day of the week effect, not week of the day... :)

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

Re: how to keep the date attached to each observation

Postby startz » Sun Nov 20, 2011 11:33 am

You're right that the smpl by itself won't work. You will need to follow Gareth's suggestion. (Which works for me too.)

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: how to keep the date attached to each observation

Postby Nau2306 » Sun Nov 20, 2011 12:04 pm

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
Attachments
usd-dates.WF1
(112.79 KiB) Downloaded 351 times

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

Re: how to keep the date attached to each observation

Postby EViews Gareth » Sun Nov 20, 2011 12:18 pm

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)

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: how to keep the date attached to each observation

Postby Nau2306 » Sun Nov 20, 2011 12:22 pm

Its similar to what I did initially. The dates disappear leaving only the observation number. :(

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

Re: how to keep the date attached to each observation

Postby EViews Gareth » Sun Nov 20, 2011 12:59 pm

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?)

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: how to keep the date attached to each observation

Postby Nau2306 » Sun Nov 20, 2011 1:15 pm

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 :)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 0 guests