data manipulation using the @holiday command

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

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

data manipulation using the @holiday command

Postby BT454 » Tue Feb 12, 2019 1:09 pm

Hi all,
I'd like to use the @holiday function to create a series that is binary for all US/North American banking holidays (1 = holiday, 0 = non holiday). I can return a series for just one holiday (i.e. @holiday(christmas), but not for multiple holidays in one series. Is this possible? If so, can you provide the syntax?
Thanks,
Bob

EViews Matt
EViews Developer
Posts: 560
Joined: Thu Apr 25, 2013 7:48 pm

Re: data manipulation using the @holiday command

Postby EViews Matt » Tue Feb 12, 2019 1:47 pm

Hello,

You can combine multiple holidays (or any dummy series) with the logical "or" operator. For example,

Code: Select all

series h = @holiday("easter") or @holiday("thanksgiving") or @holiday("christmas")

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: data manipulation using the @holiday command

Postby BT454 » Tue Feb 12, 2019 2:12 pm

Thanks!

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: data manipulation using the @holiday command

Postby BT454 » Tue Dec 15, 2020 3:43 pm

Hi all!
Circling back to this command. Is this list up to date?
http://www.eviews.com/help/helpintro.ht ... vereg.html

"..Available holiday keywords are: "easter", "labor", "newyear", "memorial", "taxday", "christmas", "july4th", "february", "thanksgiving", "mlking", "veterans", and "columbus"..."

many of these keywords crash my prg.
Thanks!
Bob

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

Re: data manipulation using the @holiday command

Postby EViews Gareth » Tue Dec 15, 2020 4:09 pm

It is.
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: data manipulation using the @holiday command

Postby BT454 » Tue Dec 15, 2020 4:15 pm

Thank you!
This code for instance crashes and gives me a missing data error

close @wf
%startrange = "1/1/2010"
%endrange = @datestr(@dateadd(@dateval(@date),1,"m"))
wfcreate(wf=holidays, page=data) d7 %startrange %endrange
series hdays = @holiday("newyear")

I'm sure i'm doing something wrong. I'm just not sure what it is since the code works with easter, christmas, and thanksgiving.
any help is appreciated, as always. Thank you again!

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

Re: data manipulation using the @holiday command

Postby EViews Gareth » Tue Dec 15, 2020 4:35 pm

The docs you referenced are for a completely different command. The @holiday function does not support those holidays.
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: data manipulation using the @holiday command

Postby BT454 » Tue Dec 15, 2020 4:49 pm

That'll do it. Is there a list of holidays supported by the @holiday command?
Thanks again!
Bob

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

Re: data manipulation using the @holiday command

Postby EViews Gareth » Tue Dec 15, 2020 5:23 pm

Yes, under the documentation for the @holiday command.
http://eviews.com/help/helpintro.html#p ... %23ww68064
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: data manipulation using the @holiday command

Postby BT454 » Wed Dec 16, 2020 1:07 pm

Thanks!

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: data manipulation using the @holiday command

Postby BT454 » Fri Dec 18, 2020 1:22 pm

Hi!
I noticed in this post there "are 4 holidays listed that are supported by @holiday. Christmas, Thanksgiving, Easter, and Chinese New Year. Just making sure I'm not missing any.
Thanks again!
Attachments
holiday.png
holiday.png (105.51 KiB) Viewed 8991 times

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

Re: data manipulation using the @holiday command

Postby EViews Gareth » Fri Dec 18, 2020 1:51 pm

Correct
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 19 guests