BookmarkSubscribeRSS Feed
arbongard
Calcite | Level 5

proc iml;

    a = {1 2, 3 4};

    c= {1 0, 0 1};

     b = a || c;

    d = echelon(b);

    x1 = d[1,3];

    x2= d[1,4] ;

    x3 = d[2,3];

    x4 = d[2,4];

    e = {0 0, 0 0};

    e[1,1] = x1;

    e[1,2] = x2;

    e[2,1]= x3;

    e[2,2]= x4;

print d, e;

Is the and easier way to put grab the take the 2x2 matrix out of the 2 by 4 matrix?

1 REPLY 1
IanWakeling
Barite | Level 11

See the section here on "extracting rows and columns".

http://support.sas.com/publishing/pubcat/chaps/63119.pdf

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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