* QUESTION: . * My variables of interest go from y1 to y800 and x1 to x3. * I want to do 800 regressions: regress var using x1, x2 and x3 where * var is successively equal to y1, y2, ...y800. * Regression is not allowed in a loop. Is there a way around? * ANSWER by rlevesque@videotron.ca 2002/04/16. * http://pages.infinit.net/rlevesqu/index.htm * Create a dummy file for illustration purposes. NEW FILE. INPUT PROGRAM. VECTOR y(20F8.0). LOOP v1=1 TO 100. COMPUTE x1=UNIFORM(5). COMPUTE x2=UNIFORM(5). COMPUTE x3=UNIFORM(5). LOOP #cnt=1 TO 20. COMPUTE y(#cnt)=UNIFORM(10). END LOOP. END CASE. END LOOP. END FILE. END INPUT PROGRAM. EXECUTE. SET MPRINT=no. * define a macro to do the job. */////////////////////////////////. DEFINE !regloop(nby=!TOKENS(1)). !DO !cnt=1 !TO !nby. REGRESSION /STATISTICS COEFF OUTS R ANOVA /DEPENDENT !CONCAT('y',!cnt) /METHOD=ENTER x1 x2 x3 . !DOEND. !ENDDEFINE. */////////////////////////////////. SET MPRINT=yes. *Call macro (replace 20 by 800 if you have y1 to y800). !regloop nby=20.