Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 11-02-2011 01:20 PM
(1062 views)

Hi all,

at first an example:

**PROC** **IML**;

a = {**1** **2** **3**} ; b = {**1**,**2**,**3**}; c = {**1** **2** **3**, **2** **3** **4**, **3** **4** **5**} ;

ssq_a = SSQ(a);

sum_b = SUM(b);

median_c = MEDIAN(c);

print a b c ssq_a sum_b median_c ;

std_a = STD(a) ;

std_c = STD(c) ;

print std_a std_c ;

**QUIT** ; *proc iml ;

My question: In the SAS Online Doc: http://support.sas.com/documentation/cdl/en/imlug/59656/HTML/default/viewer.htm#langref_sect315.htm there is a list of the "Base SAS Functions Accessible from SAS/IML". As you can see, if you run the example above, only some of the listed base functions work, like SUM, SSQ or MEDIAN, but not STD or CV. How can I use the sas base functions like STD, CV,... in IML?

Thank you in advance for every tip, best regards,

saibot

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

1) This issue is discussed and solved in Section 4.9 of my book, *Statistical Programming with SAS/IML Software*.

2) If you are using SAS IML 9.22 or beyond, you can use the VAR function, and of course STD=sqrt(VAR(..)). SAS 9.3 supports the STD function directly.

For more on this topic, see my blog: http://blogs.sas.com/content/iml/2011/06/08/calling-base-sas-functions-from-sasiml-how-to-handle-arg...

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

1) This issue is discussed and solved in Section 4.9 of my book, *Statistical Programming with SAS/IML Software*.

2) If you are using SAS IML 9.22 or beyond, you can use the VAR function, and of course STD=sqrt(VAR(..)). SAS 9.3 supports the STD function directly.

For more on this topic, see my blog: http://blogs.sas.com/content/iml/2011/06/08/calling-base-sas-functions-from-sasiml-how-to-handle-arg...

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you very much for your help, Rick. I tried the function GetArgList that you proposed in your blog and it worked fine.

I am very surprised that the use of such elementary functions in IML is so complicated. In some cases, for example for such simple functions like STD or CV, the programming "by hand" is easier to read than the three steps "GetArgList --> Creation of Macro Variable --> Use of SAS-Base function with macro variable". But as more base functions are available in higher SAS versions, it seems that SAS is working on that topic.

Thank you and best regards,

saibot

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.