Page 1 of 1

Question on data manipulation- restricting the sample based on a dummy's value

Posted: Sun Nov 27, 2016 5:35 am
by bvasu
Hi there,

Quick question on how to perform this operation:
I have a series of data for changes to the Bank of Canada's target for the Overnight rate, and a series of bond yields. I'm trying to restrict my sample of yields to 15 days before and after the bank changes their target.
I've generated a dummy variable to indicate dates when the bank changed their rate, and recoded this to the date, and generated a series of 15 days above and below this in hopes of using the @during function.... but that does not seem to work.
Any inputs?

Thanks much.

This is my code thus far: keep is the series of BOC changes to the target for the overnight.

Code: Select all

genr d1 = @recode(keep >0 or keep<0, @date,0) genr below_days = @recode(d1>0,d1-15,0) genr above_days = @recode(d1>0,d1+15,0)

Re: Question on data manipulation- restricting the sample based on a dummy's value

Posted: Sun Nov 27, 2016 5:59 am
by EViews Gareth
Something like:

Code: Select all

group dummies d1(-15 to 15) smpl if @rsum(dummies)=1

Re: Question on data manipulation- restricting the sample based on a dummy's value

Posted: Sun Nov 27, 2016 6:52 am
by bvasu
Thank you for the prompt reply. It worked wonderfully!