Reshape your data then use reg to estimate all of them. It is faster, simpler in logic. Here is an example.
data testdata;
do date=today()-29 to today();
x1=rannor(123);x2=rannor(123);err=rannor(123);
y=1+2*x1+0.5*x2+err;
output;
end;
format date yymmdd10.;
run;
data rollddata;
do p1=1 to n-11;
do p2=p1 to p1+11;
set testdata point=p2 nobs=n;
output;
end;
end;
stop;
run;
proc reg data=rollddata outest=parm noprint;
by p1;
model y=x1 x2;
run;
quit;
proc print data=parm;
run;
proc means data=parm n mean std;
var Intercept x1 x2
;
run;
|