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
- /
- BI
- /
- Enterprise Guide
- /
- Multiply matrix and vector with proc iml

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-14-2017 11:37 AM

Hello,

I am trying to multiply a matrix and a vector with proc iml, but I never used it,.

Basically, I already have the two datasets that I need, one MATRIX and one VECTOR.

I simply want the resulting vector of the multiplication of MATRIX*VECTOR in a new dataset with one variable named RESULT.

Accepted Solutions

Solution

12-20-2017
10:16 AM

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

Posted in reply to x2PSx

12-15-2017 09:11 AM

Better post is at IML forum, since it is a IML question.

```
data matrix;
set sashelp.class;
keep age weight height;
run;
data vector;
do vector=1 to 3;
output;
end;
run;
proc iml;
use matrix;
read all var _num_ into matrix;
close;
use vector;
read all var {vector};
close;
result=matrix*vector;
create result var {result};
append;
close;
quit;
```

All Replies

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

Posted in reply to x2PSx

12-14-2017 12:33 PM

Here's an introductory resource to PROC IML that I hope you'll find helpful. Rick also publishes "The DO Loop" blog for SAS.

http://support.sas.com/resources/papers/proceedings13/144-2013.pdf

In the future, I suggest you post IML questions to the Analytics / SAS/IML area. The Enterprise Guide area tends to get questions about the EG interface, and the IML folks don't tend to watch it.

Tom

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

Posted in reply to TomKari

12-14-2017 02:29 PM

Thank you, will do!

Solution

12-20-2017
10:16 AM

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

Posted in reply to x2PSx

12-15-2017 09:11 AM

Better post is at IML forum, since it is a IML question.

```
data matrix;
set sashelp.class;
keep age weight height;
run;
data vector;
do vector=1 to 3;
output;
end;
run;
proc iml;
use matrix;
read all var _num_ into matrix;
close;
use vector;
read all var {vector};
close;
result=matrix*vector;
create result var {result};
append;
close;
quit;
```