Page 1 of 1

How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 9:59 am
by gcg
Hi,

I have a program and I am trying to do a calculation on a dataset that increases by one obs for each series. My question is how to make eviews advance sideways on a set of series. For example, the first two series have 20 and 21 obs, respectively. The third has 22, the fourth has 23, etc. I want to perform a calculation first on series 1and 2. Then on series 1,2,and 3. Then on 1,2,3, and 4. etc.

The way I have it now is not allowing the data set to grow by adding a new series "sideways" as desired. Any suggestions would be much appreciated. Thanks!

for !i = 1 to !length-1-!window

'set sample to estimation period for xxx series
smpl 1971:01 1971:01+!window-1+!i-1
!n = @obs(xxx_25)

'find the largest number of series with #obs at least equal to window and make program add a series each time
!k = 0
for !j = 2 to 25
if (@obs(xxx_!j) >= !window) then
!k = !j
endif
next

Re: How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 10:07 am
by EViews Gareth
I'm not quite sure I understand what you're doing, or why what you are currently doing is not achieving what you want to achieve.

What does "advance sideways" mean?

Re: How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 10:12 am
by gcg
I just mean that I want to increase the number of series in the group by one at each iteration, and each series has one more obs than the one before it. Then I perform another calc on the groups, which increase by one series. The first group has two series, the second has three, then 4, 5, etc. But I cant seem to get the groups to grow by one series progressively. Instead Eviews is taking all 25 series at once.

Re: How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 10:15 am
by EViews Gareth

Code: Select all

group xs for %xname x1 x2 x3 x4 x5 x6 x7 x8 xs.add {%name} 'do calculation on xs here next

Re: How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 10:16 am
by gcg
thanks - I'll give it a try and report back

Re: How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 11:17 am
by gcg
does not work, unfortunately. Eviews still taking all the series at once. Any other suggestions?

Re: How to make program advance one obs sideways

Posted: Tue Aug 18, 2009 11:22 am
by EViews Gareth
You'll have to be more specific.

The code I posted adds the series one at a time. The most likely thing is that you have not implemented it in your code properly, but without seeing your code, that is impossible to say.