Page 1 of 1

copying from multiple pages

Posted: Fri Sep 16, 2011 2:53 pm
by met
Hi,

I have a workfile with 6 pages. For simplicity reasons let's say that each page stores for a specific stock, its share price on 10 dates.
What is the best way to pick the share prices of each stock on a given day, copy the prices to a new workfile and calcutate the mean share price of all 6 stocks on a specific day? Was using several pages in one workfile the right start anyway? Programming commands would be useful as I have to repeat the step.

My dataset is little bit more complicated as, among others, it involves multiple prices per day (unstructured workfile, using version 6), however I guess the method should be similar!?

A different question: Is there any way to aggregate unregular millisecond stamped observations to a regular minute frequency?

Thanks for helping again!

Re: copying from multiple pages

Posted: Fri Sep 16, 2011 2:55 pm
by EViews Gareth
It isn't clear what you're asking here, but perhaps you just need to use the copy command?

Re: copying from multiple pages

Posted: Fri Sep 16, 2011 4:30 pm
by met
Ok sorry! I try again.

I would upload the workfile but unfortunately I'm currently at home.

I have 1 workfile with 6 pages. Each page contains data on one stock which I copied from Excel. So data on Page 1 on Stock A would look like this for example.

Date-----------------Time--------Eff_Spread
09/01/2009 ------ 11:05:02.540 ------ 6.71
09/01/2009 ------ 15:42:05.020 ------ 6.79
... ... ...
09/10/2009 ------ 09:02:50:110 ------ 6.36
09/10/2009 ------ 12:20:04:000 ------ 6.35
09/10/2009 ------ 14:17:17.710 ------ 6.39

Now, I want Eviews to pick from every page (from every stock) the observations on 09/01/2009, calculate the mean spread per share on that day and store the results somewhere, giving me the average spread per day for each share

Here: mean eff_spread for stock A on 09/10/2009: 6.75 bps

Hope it was somehow more understandable now.

Thank you!

copying from multiple pages

Posted: Fri Sep 16, 2011 4:51 pm
by EViews Gareth
Yep, you want the copy command to copy from your source pages to a destination page with a single observation for the day you're interested in.

Re: copying from multiple pages

Posted: Sat Sep 17, 2011 2:05 pm
by met
Probably stupid question but what is the best way to get the single observation (mean of a specific day) ? Getting the mean of the sample day is not the problem but when i create a new series for the mean Eviews of course keeps the number of observations in the sample and fills it up with the mean of the total sample. For example when I have 3 observations and the mean is 9, i get
1. 9
2. 9
3. 9
etc
rather than
1. 9

An way over frequency conversion is not possible in Eviews 6? So that when i copy into a series containing the 10 days of my observation period, EViews would automatically aggregate the intra-day data to a daily frequency?

Thanks Gareth!

copying from multiple pages

Posted: Sat Sep 17, 2011 4:07 pm
by EViews Gareth
Ah. Yes, in EViews 6 this is going to be tricky. Easiest thing to do might be to upgrade to EViews 7, which can handle intra-day data.

Re: copying from multiple pages

Posted: Mon Sep 19, 2011 9:08 am
by met
Ok. Would EViews 7 then be able to automatically convert by irregular millisecond time series into a regular second (millisecond??) stamped intra-day series?
Could you provide me the solution to my question about the mean into a single observation problem in my last post?

Thank you!

Re: copying from multiple pages

Posted: Mon Sep 19, 2011 9:20 am
by EViews Gareth
EViews 7 won't handle regular millisecond data. It will let you go from millisecond irregular to a minute regular though.

As I said before, to get the mean into a single observation, you're really just doing frequency conversion (and/or general match-merge copying). Just use the copy command to copy from your source (with multiple observations) into your destination (with a single observation) and tell EViews to use averaging as the contraction method.

Re: copying from multiple pages

Posted: Mon Sep 19, 2011 1:07 pm
by met
Here is what I do:

Code: Select all

copy(c=a) hannoverruck\wprice_impact day_average\
Hannoverruck is my source page (unstructured, 67859 observations)
day_average my destination page(unstructured, 1 observation)
wprice_impact my series

However, the observation in the series in the destination file is only replaced by the first observation of the observations in my source file, not the mean of the observations!?

Re: copying from multiple pages

Posted: Mon Sep 19, 2011 1:50 pm
by EViews Gareth
You probably need to do a general match merge copy, rather than a frequency conversion.

Re: copying from multiple pages

Posted: Wed Sep 21, 2011 2:51 pm
by met
Hi,
I finally should get access to EVIews 7 tomorrow! So how should i start for my project! How can I convert my irregular intra-day data to a regular spaced series? Why did you wrote millisecond to minute would be possible? I thought version 7 could handle second stamped data?

Thanks for helping!
Met

Re: copying from multiple pages

Posted: Wed Sep 21, 2011 3:24 pm
by EViews Gareth
millisecond to second would also be possible.

You'll have a page with your millisecond data. In that page you'll have a series with the time stamp. You'll create a new page that is regular second (or minute). You'll do a general match merge copy from the first page to the second using the timestamp series that the source ID, and @date for the destination ID. (note that, @date is a keyword for a series containing the date/time stamp in the regular page).