turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc IML help

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-01-2010 05:26 PM

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;

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;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-01-2010 08:48 PM

Suggest you re-post in the dedicated SAS/IML forum?

Scott Barry

SBBWorks, Inc.

Scott Barry

SBBWorks, Inc.