SAS Studio

Write and run SAS programs in your web browser
BookmarkSubscribeRSS Feed
Mustafa86
Calcite | Level 5

 how to write the code for sample mean vector for 3*3 matrix in SAS iml the equation for it is attached in the document

the matrix is {1 2 -1,

                       2 4 4,

                      1 5 -2};

3 REPLIES 3
Reeza
Super User

MeanM = mean(myMatrix);
If you want it transposed, use the T()function.

IML functions are listed here
https://documentation.sas.com/?docsetId=imlug&docsetTarget=imlug_langref_sect253.htm&docsetVersion=1...

 


@Mustafa86 wrote:

 how to write the code for sample mean vector for 3*3 matrix in SAS iml the equation for it is attached in the document

the matrix is {1 2 -1,

                       2 4 4,

                      1 5 -2};


 

Ksharp
Super User

Post it at IML forum @Rick_SAS is there.

Rick_SAS
SAS Super FREQ
proc iml;
x = {1 2 -1,
     2 4 4,
     1 5 -2};

colMean = mean(x); /* means of each column */
print colMean;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3367 views
  • 2 likes
  • 4 in conversation