Page 1 of 1

Looping series

Posted: Wed Jul 15, 2009 8:09 am
by hw180286
Hi I'm a bit of a newbie with eviews programming and dont really get it!

I want to carry out a really simple thing.

Basically I have about 100 time series, OLS equations i want to estimate . For simplicity say I have a dependent variable Fruitprice, an explanatory variable vegetableprice and a specific fruit that i want for the additional explanatory variable which varies across each esimation eg.

Fruitprice c vegetableprice orange
Fruitprice c vegetableprice apple
x97 different fruits
Fruitprice c vegetableprice peach

Is there a loop i can use in which i can just copy all the fruit names into a list and loop through each one. I used to use Aremos and you could do something like:

For i = orange, apple, peach,...........;

equation "i".ls fruitprice c vegetableprice "i"

next i

Your help would be greatly appreciated!!!

Re: Looping series

Posted: Wed Jul 15, 2009 8:17 am
by EViews Gareth
You could do it in a similar fashion to Aremos:

Code: Select all

for %i orange apple peach equation eq_{%i}.ls fruitprice c vegtableprice {%i} next
However, perhaps an easier approach would be to put all 97 fruits into a group, say called FRUITS, then do:

Code: Select all

for !i =1 to fruits.@count %name = fruits.@seriesname(!i) equation eq_{%name}.ls fruitprice c vegtableprice {%name} next

Re: Looping series

Posted: Wed Jul 15, 2009 8:44 am
by hw180286
That's amazing! thanks so much!!

I dont suppose there is a way of copying all the results to excel somehow?

many thanks again.

Howard

Re: Looping series

Posted: Wed Jul 15, 2009 8:51 am
by EViews Gareth
There's lots of similar questions already posted, and I'm sure with a search you can find a more thorough answer, but the general reply is that the easiest thing to do is add all of your equation outputs to a spool, then print the spool to an rtf file.