Page 1 of 1

Importing hourly data from a file with hour numbers

Posted: Wed Feb 10, 2010 1:31 pm
by EViews Chris
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'.

Re: Importing hourly data from a file with hour numbers

Posted: Wed Mar 14, 2012 11:57 pm
by deepaib
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.