Page 1 of 1

Is that possible to run several series at once time?

Posted: Sat Mar 07, 2015 10:34 am
by Aixia_Mei
Hi Tom,

There are 500 stocks series, named as S1 S2 S3 etc... in my excel spreadsheet. I want to get regression result of each of them separately.
Is that possible to input all the name of these 500 series at once time and finally get their results altogether?
That will save a lot of work.

My current codes is like:

Code: Select all

OPEN DATA "C:\Users\aixia\Desktop\51 return"
CALENDAR(D) 2006:04:03
DATA(FORMAT=XLS,ORG=OBS) 2006:04:03 2010:03:30 S1
*
set r1 = S1
Many thanks,
Aixia

Re: Is that possible to run several series at once time?

Posted: Sat Mar 07, 2015 2:47 pm
by TomDoan
Just read the whole data set (leave the "list of series" blank). The following shows "pseudo-code" for handling the loop over the series. This is saving one piece of information per series, but it's not hard to save more than that by either defining more than one target series, or by making the target a VECT[VECT].

dec vector myresults(500)
do i=1,500
set r = %s("s"+i)
do stuff with r
save information into myresults(i)
end do i

Re: Is that possible to run several series at once time?

Posted: Sat Mar 07, 2015 3:27 pm
by Aixia_Mei
So many thanks Tom. It does work.
Will save me a lot of time.

best wishes,
Aixia