BookmarkSubscribeRSS Feed
bri11
Calcite | Level 5

so I've just been messing around trying to figure out how to write modules and I'm trying to create a module that will input three matrices that are all 3x3 and then returns the one with the largest determinant. So far I've just created a module that takes the determinant of whatever matrix I tell it too but I can't figure out how to do anything else.

proc iml;

start module(A, D);

      D= det(A);

finish;

*creating a matrices;

A = {5 8 1,

     2 6 4,

     6 6 6};

B = {5 8 9,

     2 4 1,

     2 2 2};

C = {4 4 4,

     9 8 7,

     3 3 3};

*calls the module from above;

run module(A, D);

print A;

print D;

run module(B, D);

print B;

print D;

run module(C, D);

print C;

print D;

1 REPLY 1
IanWakeling
Barite | Level 11

There is a very similar thread here:

https://communities.sas.com/message/209655

That you might want to look in to!

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
  • 742 views
  • 0 likes
  • 2 in conversation