BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Yanni_C
Fluorite | Level 6

I have a matirx datasetA (7*7), and I want to get the inverse matrix of this datasetA and save this inverse matrix in datasetB. Could you please tell me how to implement it using sas?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

It is IML thing. You'd better post it at IML forum

https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml

,and calling @Rick_SAS 

 

data A;
input a1-a7;
cards;
1 2 9 5 5 6 7
4 2 3 1 5 6 4
1 4 6 2 9 6 3
6 8 7 3 8 6 2
8 7 8 8 9 6 1
3 1 3 9 1 6 6
2 7 3 4 2 6 7
;


proc iml;
use A;
read all var _all_ into a[c=vname];
close;
inv_a=inv(a);
create B from inv_a[c=vname];
append from inv_a;
close;
quit;

View solution in original post

2 REPLIES 2
Ksharp
Super User

It is IML thing. You'd better post it at IML forum

https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml

,and calling @Rick_SAS 

 

data A;
input a1-a7;
cards;
1 2 9 5 5 6 7
4 2 3 1 5 6 4
1 4 6 2 9 6 3
6 8 7 3 8 6 2
8 7 8 8 9 6 1
3 1 3 9 1 6 6
2 7 3 4 2 6 7
;


proc iml;
use A;
read all var _all_ into a[c=vname];
close;
inv_a=inv(a);
create B from inv_a[c=vname];
append from inv_a;
close;
quit;
Yanni_C
Fluorite | Level 6

Thank you very much! Really helpful!

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