Finding specific day of month

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

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

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Finding specific day of month

Postby jthodge » Tue Aug 17, 2010 12:17 pm

I have a monthly workfile and need to determine the date representing the first Thursday for each observation month.

Can anyone figure out a formula for creating this series?

genr first_thurs = ???

Code: Select all

obs first_thurs 2009M01 1/1/2009 2009M02 2/5/2009 2009M03 3/5/2009 2009M04 4/2/2009 2009M05 5/7/2009 2009M06 6/4/2009 2009M07 7/2/2009 2009M08 8/6/2009 2009M09 9/3/2009 2009M10 10/1/2009 2009M11 11/5/2009 2009M12 12/3/2009

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

Finding specific day of month

Postby EViews Gareth » Tue Aug 17, 2010 12:28 pm

This is from the top of my head on my phone, but something like:

Code: Select all

smpl if @weekday=5 and @month<>@month(-1) Series firstthurs = @datestr(@date,"yyyy/mm/dd") Smpl @all

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

Finding specific day of month

Postby EViews Gareth » Tue Aug 17, 2010 12:30 pm

Wait, you said monthly workfile, so my above solution won't work. I'll come up with something after lunch

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

Re: Finding specific day of month

Postby EViews Chris » Tue Aug 17, 2010 1:41 pm

I think this will do what you want:

Code: Select all

series first_thurs = @date + @recode(@weekday > 4, 11 - @weekday, 4 - @weekday)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest