BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Good day,

I have been struggling for a while trying to get this program to work. It keeps on giving me the error: Error (Execution) Matrix has not been set to a value.

Could someone be so kind as to point out where I am going wrong?

This is the code:

proc iml;

n = 200;
k = 3;
g = 30;


do it = 1 to g ;

x = J(n,k,1) ;
u = J(n,1,99999) ;
y = J(n,1,99999) ;
sd = J(n,1,0);
rst = J(n,1,99999);


do i= 1 to n;

x2[i,2] = ranuni(sd)*100+100;
x3[i,2] = ranuni(sd)*50+150;
u[i,1] = rannor(sd)*100;
y[i,1] = 100+3*x2[i,2]+15*x3[i,2]+u[i,1];
x = J(n,1,1) || x2[i,2] || x3[i,2];
end;
bh = inv(x`*x)*x`*y;
print bh;

rst[it,] = bh`;

print rst;
end;
quit;
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you re-post in the dedicated SAS/IML forum?

Scott Barry
SBBWorks, Inc.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 909 views
  • 0 likes
  • 2 in conversation