Page 1 of 1

selecting a subsample in high frequency data

Posted: Wed May 14, 2008 9:07 am
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?

Re: selecting a subsample in high frequency data

Posted: Wed May 14, 2008 12:33 pm
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).