selecting a subsample in high frequency data

For questions and discussion related to reading in and working with data.
moroche
Posts: 4
Joined: Mon Mar 19, 2007 11:18 am

selecting a subsample in high frequency data

Unread post by moroche »

Tom,
I have version 7 of RATS.
I have a seven day dataset with observations per minute - 1440 per day from 2001/01/01 to 2006/12/31.

I have set the calender command as cal(7,ppd=1440) 2001 01 01

How can I select a sample that ignores the data from 9pm on Friday to 9pm on Sunday?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: selecting a subsample in high frequency data

Unread post by TomDoan »

moroche wrote:Tom,
I have version 7 of RATS.
I have a seven day dataset with observations per minute - 1440 per day from 2001/01/01 to 2006/12/31.

I have set the calender command as cal(7,ppd=1440) 2001 01 01

How can I select a sample that ignores the data from 9pm on Friday to 9pm on Sunday?
This would set up the dummy to exclude those periods.

Code: Select all

compute ninepm=21*60+1
set smpl = %weekday(t)<=4.or.$
                    %weekday(t)==5.and.%period(t)<ninepm.or.$
                    %weekday(t)==7.and.%period(t)>=ninepm
%period returns the period within the day and %weekday returns
the day of the week of the entry (1=Monday, so 5=Friday and
7=Sunday).
Post Reply