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

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

04-21-2015 12:53 PM

Hi everyone. I have a question regarding multiplying matrices. I already read Interpreting PROC IML error messages: Matrices do not conform to the operation suggested in other boards and I still do not understand why I get this message. I understand that if I want to multiply xbeta = x # beta; the number of columns in X have to be equal to the rows in beta, right? I am running SAS 9.4

This is part of my code:

xbeta = x#beta;

se= sqrt (vecdiag(x#cov#x`));

lower =xbeta - (1.96 # se);

upper =xbeta + (1.96 # se);

When I run the operation I get this on the log:

ERROR: (execution) Matrices do not conform to the operation.

operation : # at line 15164 column 14

operands : X, BETA

X 502 rows 6 cols (numeric)

BETA 6 rows 1 col (numeric)

And also when I try to perform this operation x#cov

operation : # at line 15164 column 80

operands : X, COV

X 502 rows 6 cols (numeric)

COV 6 rows 6 cols (numeric)

What am I doing wrong? Thanks!

Accepted Solutions

Solution

04-21-2015
01:32 PM

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

Posted in reply to AM2323

04-21-2015 01:32 PM

All Replies

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

Posted in reply to AM2323

04-21-2015 01:18 PM

# is elementwise multiplication.

* is matrix multiplication

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

Posted in reply to gergely_batho

04-21-2015 01:28 PM

When I change # to * I get the following error.

ERROR: (execution) Invalid argument or operand; contains missing values.

operation : * at line 15164 column 14

operands : X, BETA

X 502 rows 6 cols (numeric)

BETA 6 rows 1 col (numeric)

Solution

04-21-2015
01:32 PM

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

Posted in reply to AM2323

04-21-2015 01:32 PM

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

Posted in reply to AM2323

04-21-2015 01:28 PM