Importing hourly data from a file with hour numbers

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

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

Importing hourly data from a file with hour numbers

Postby EViews Chris » Wed Feb 10, 2010 1:31 pm

A few customers have asked how to use a file containing hourly data with one column containing the day and one column containing the hour number (generally from 1 to 24). For example:

Code: Select all

day   hour   x
4/3/2008   1   100
4/3/2008   2   200
4/3/2008   3   300
4/3/2008   4   400
4/3/2008   5   500
4/3/2008   6   600
4/3/2008   7   700
4/3/2008   8   800
4/3/2008   9   900
4/3/2008   10   1000
4/3/2008   11   1100
4/3/2008   12   1200
4/3/2008   13   1300


EViews 7 doesn't recognize this date format automatically (although it will if the second column contains times like '3:00' instead of integers), but you can give EViews something it will know what to do with by using the following expression as the 'date identifier series' during import or when restructuring the workfile.

Code: Select all

@dateadd(day, hour-1, "h")


This simply tells EViews to add 'hour-1' hours to the day series, which will create a combined date-time value that EViews will be able to recognize.

If the hours are numbered from 0 to 23, you can use the same expression without subtracting one from 'hour'.

deepaib
Posts: 7
Joined: Tue Mar 13, 2012 9:38 pm

Re: Importing hourly data from a file with hour numbers

Postby deepaib » Wed Mar 14, 2012 11:57 pm

Hi,

Thanks for the above post. This helped me to import 60min and 120min data as dated panel by using @dateadd. But, I am now stuck with other time frames like 90min,30min and other smaller timeframes. Attached here is the sample data. When I use "mi" as frequency source while importing, I see that the EViews is not detecting the frequency properly and I am ending up with data where time difference (90min) is not continuous. Also, if you note my data, column 'ttime' is not continuous which is due to the gap in trading time of stock exchange. I tried replacing the values of column ttime such that trading time is continuous like 0900,1030,1200 etc (this is in sheet2). But still its not working. Could you please help me import these timeframes data as proper 2D panel?

Thanks much for this useful forum.
Attachments
sample 90min data.xlsx
(116.84 KiB) Downloaded 198 times


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 2 guests