When I try to rewrite the orginal code to fit my data, it always appears that "ERROR: (execution) Matrix has not been set to a value.".
But I don't know where can I correct them. By the way, I want to know how to store het_y into a column form.
Thanks a million.
proc IML;
use work.jb_test_data;
read point (1:252) var{BIDLO ASKHI PRC VOL RET} into m;
n=nrow(m); r=ncol(m);
y=m[,5]; x=shape(1,n,1)||m[ ,1:2:3:4];
beta=inv(t(x)*x)*t(x)*y;
sigma=sqrt(t(y-x*beta)*(y-x*beta)/(n-r));
se=sigma*sqrt(vecdiag(inv(t(x)*x)));
het_y=x*beta;
print het_y;