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. I am trying to generate a sample space from n observations and repeating it g times. My aim is to find the beta hat parameters and to place them into a results (rst) matrix.

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 = ranuni(sd)*100+100;
x3 = ranuni(sd)*50+150;
u = rannor(sd)*100;
y = 100+3*x2+15*x3+u;
x = J(n,1,1) || x2 || x3;
end;
bh = inv(x`*x)*x`*y;
print bh;

rst[i,] = bh`;

print rst;
end;
quit; Message was edited by: Reytla
1 REPLY 1
deleted_user
Not applicable
I've sorted it out. Thanks all the same!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 680 views
  • 0 likes
  • 1 in conversation