Having a for loop that runs through the 200 names is slightly unworkable, so Startz's method might not be the best.
I would put the dependent variables (all 200 of them) into a group, then use the group to run through the regressions. Something like:
Code: Select all
'create a workfile
create u 100
group regs 'group for the X variables
group deps 'group for the Y variables
'create some data
for !i = 1 to 5
series x!i=nrnd
regs.add x!i
next
for !i=1 to 200
series y!i = nrnd
deps.add y!i
next
'matrix to hold results - number of rows is equal to number of dependent variables, number of columns is equal to number of regressors
matrix(deps.@count,regs.@count) coefs
'declare equation object to be used inside loop
equation e1
'now do estimations
for !i = 1 to deps.@count
e1.ls deps(!i) regs
rowplace(coefs,@transpose(e1.@coefs),!i)
next
Note that that is a stand alone program - you would not need the data creation parts, you would just need to put the dependent variables in the group "deps" and the regressors in the group "regs"