save quarterly data in workfile with 10min frequency

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

aeda
Posts: 6
Joined: Wed Nov 13, 2013 1:07 am

save quarterly data in workfile with 10min frequency

Postby aeda » Wed Nov 13, 2013 1:18 am

Hey guys

I have a dataset (in Excel) consisting of quarterly observations. For each of these Observations, I also have an exact date and time, like: Obs.value, 20000101, 07:00.

Also I created an eViews Workfile with 10 Minute frequency. Now I want to import that quarterly data to the eViews workfile. For all (10min frequency) observations where there is no corresponding value in the data, the observation value should be zero. That means in the end I need to have a 10 Min frequency vector with one observation value per quarter and zeros otherwise:

. . . .

20000101, 06:50, 0

20000101, 07:00, Obs. Value (one per quarter)

20000101, 07:10, 0

. . .

Does anyone know how to programm that in eViews?

thanks a lot!

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

Re: save quarterly data in workfile with 10min frequency

Postby EViews Chris » Wed Nov 13, 2013 12:51 pm

It's not entirely clear from your post what you've already tried.

If your Excel file has date/time data and you import it into a 10 minute workfile, EViews should fill in the observations that have matching date/time values and leave the rest of the observations as missing values (NAs). If you're not seeing this, then you may need to help EViews understand how the timestamp in your Excel file is coded.

You would then need to swap out the missing values with zeros in a second step. For example:

x = @recode(x<>na, x, 0)

will replace all the NA values in the series x with zeros.

aeda
Posts: 6
Joined: Wed Nov 13, 2013 1:07 am

Re: save quarterly data in workfile with 10min frequency

Postby aeda » Thu Nov 14, 2013 3:03 am

Thanks a lot for your reply!
The problem I now have is that in the Excel file, the dates are stored in two separate rows (date=one row, time=one row):
Obs.value, YYYYMMDD, HH.MM, for example
20, 20001201, 7.30
All values are stored as numbers, not in the date format.

Is there any way I can tell eviews how to correctly read this data?
(ie to put the value 20 to the obs on dec first 2000, 07.30 am)
Or do i have to transfer the time data into a date format as 01.12.2000 07:30 and then load the data in eViews?


Thanks a lot!

aeda
Posts: 6
Joined: Wed Nov 13, 2013 1:07 am

Re: save quarterly data in workfile with 10min frequency

Postby aeda » Thu Nov 14, 2013 6:59 am

... now I even tried with the "correct" date format (I transformed the number-values in Excel to Date-Time Values) but it didnt work.
Eviews just stores the values in the first observation periods.

I attached an example with just two observations.
Here's the code I use to load the data:

'setting working directory
'************************************
%path="U:\test\"
%path=@runpath
cd %path

'read in data
'************************************
wfcreate (wf=wfex) 10mi 2003 2004
%temppath = %path + "example2.xls"
read(a1) %temppath 2

smpl @all
wfsave "wfex.wf1"
'wfclose
'exit

Does anyone know how to solve that?
Thanks!!
Attachments
example2.xls
(28 KiB) Downloaded 652 times

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

Re: save quarterly data in workfile with 10min frequency

Postby EViews Gareth » Thu Nov 14, 2013 7:27 am

Don't use READ. Use WFOPEN or IMPORT.

aeda
Posts: 6
Joined: Wed Nov 13, 2013 1:07 am

Re: save quarterly data in workfile with 10min frequency

Postby aeda » Thu Nov 14, 2013 7:39 am

Did it work for you with the IMPORT command?
Could you provide your code then?
Thank you!!

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

Re: save quarterly data in workfile with 10min frequency

Postby EViews Gareth » Thu Nov 14, 2013 8:17 am

An example file with only two observations isn't much use.

aeda
Posts: 6
Joined: Wed Nov 13, 2013 1:07 am

Re: save quarterly data in workfile with 10min frequency

Postby aeda » Mon Nov 18, 2013 4:05 am

okay heres some more observations.

many thanks
Attachments
sample.xlsx
(9.56 KiB) Downloaded 670 times

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

Re: save quarterly data in workfile with 10min frequency

Postby EViews Gareth » Mon Nov 18, 2013 7:38 am

Code: Select all

wfcreate 10mi 2005 2013 import sample.xlsx
Seems to work just fine.

aeda
Posts: 6
Joined: Wed Nov 13, 2013 1:07 am

Re: save quarterly data in workfile with 10min frequency

Postby aeda » Tue Nov 19, 2013 5:46 am

ah I finally found why it didnt work...
there were some issues in my original data.
thanks a lot for helping me out!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests