selecting a subsample in high frequency data

For questions and discussion related to reading in and working with data.

selecting a subsample in high frequency data

Postby moroche » Wed May 14, 2008 9:07 am

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?
moroche
 
Posts: 4
Joined: Mon Mar 19, 2007 11:18 am

Re: selecting a subsample in high frequency data

Postby TomDoan » Wed May 14, 2008 12:33 pm

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).
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to Data: Reading, Writing, Transforming

Who is online

Users browsing this forum: No registered users and 1 guest

cron