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

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

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

bvasu
Posts: 2
Joined: Sun Nov 27, 2016 4:20 am

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

Postby bvasu » Sun Nov 27, 2016 5:35 am

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)

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

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

Postby EViews Gareth » Sun Nov 27, 2016 5:59 am

Something like:

Code: Select all

group dummies  d1(-15 to 15)
smpl if @rsum(dummies)=1
Follow us on Twitter @IHSEViews

bvasu
Posts: 2
Joined: Sun Nov 27, 2016 4:20 am

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

Postby bvasu » Sun Nov 27, 2016 6:52 am

Thank you for the prompt reply. It worked wonderfully!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 23 guests