Page 1 of 1
save quarterly data in workfile with 10min frequency
Posted: Wed Nov 13, 2013 1:18 am
by aeda
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!
Re: save quarterly data in workfile with 10min frequency
Posted: Wed Nov 13, 2013 12:51 pm
by EViews Chris
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.
Re: save quarterly data in workfile with 10min frequency
Posted: Thu Nov 14, 2013 3:03 am
by aeda
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!
Re: save quarterly data in workfile with 10min frequency
Posted: Thu Nov 14, 2013 6:59 am
by aeda
... 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!!
Re: save quarterly data in workfile with 10min frequency
Posted: Thu Nov 14, 2013 7:27 am
by EViews Gareth
Don't use READ. Use WFOPEN or IMPORT.
Re: save quarterly data in workfile with 10min frequency
Posted: Thu Nov 14, 2013 7:39 am
by aeda
Did it work for you with the IMPORT command?
Could you provide your code then?
Thank you!!
Re: save quarterly data in workfile with 10min frequency
Posted: Thu Nov 14, 2013 8:17 am
by EViews Gareth
An example file with only two observations isn't much use.
Re: save quarterly data in workfile with 10min frequency
Posted: Mon Nov 18, 2013 4:05 am
by aeda
okay heres some more observations.
many thanks
Re: save quarterly data in workfile with 10min frequency
Posted: Mon Nov 18, 2013 7:38 am
by EViews Gareth
Code: Select all
wfcreate 10mi 2005 2013
import sample.xlsx
Seems to work just fine.
Re: save quarterly data in workfile with 10min frequency
Posted: Tue Nov 19, 2013 5:46 am
by aeda
ah I finally found why it didnt work...
there were some issues in my original data.
thanks a lot for helping me out!