Is that possible to run several series at once time?

For questions and discussion related to reading in and working with data.
Aixia_Mei
Posts: 29
Joined: Wed Dec 03, 2014 7:16 pm

Is that possible to run several series at once time?

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

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

Unread post 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
Aixia_Mei
Posts: 29
Joined: Wed Dec 03, 2014 7:16 pm

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

Unread post by Aixia_Mei »

So many thanks Tom. It does work.
Will save me a lot of time.

best wishes,
Aixia
Post Reply