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 03-13-2014 01:56 PM
(2068 views)

bonjour,

n'étant pas un fin connaisseur de SAS/IML, j"aimerais savoir dans un premier temps quelle est la différence entre SAS/IML et SAS/IML studio.

Par ailleurs, je souhaiterais utiliser la fonction sample et un message d'erreur apparaît m'indiquant qu'elle n'est pas disponible dans ma version de SAS/IML STUDIO (3.4).

Existerait elle donc dans SAS/IML? (je dispose de la version 9.3 de sas?

merci pour vos retours

1 ACCEPTED SOLUTION

Accepted Solutions

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

Hello,

Please excuse me for not responding in French. I do not know the language well.

For a description of SAS/IML Studio, see the 2008 paper or the Introduction to the 2010 paper at SAS/IML and SAS/IML Studio Papers and Presentations Briefly, SAS/IML is the product that you license. It is also the name of a matrix language. PROC IML implements the matrix languiage on the SAS server. SAS/IML Studio is a development environment that enables SAS/IML programmers to develop SAS/IML programs. SAS/IML Studio runs on a Windows PC. It runs programs in IMLPlus, which is a language that includes SAS/IML syntax plus a Java-like syntax for creating dynamically linked graphics.

The SAMPLE function was introduced in SAS/IML 12.1 (See SAS/IML(R) 12.1 User's Guide). For SAS/IML 9.3, you can use a function from the book* Statistical Programming with SAS/IML Software*. See the links in the first paragraph of the article Sampling with replacement: Now easier than ever in the SAS/IML language - The DO Loop

7 REPLIES 7

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

Hello,

Please excuse me for not responding in French. I do not know the language well.

For a description of SAS/IML Studio, see the 2008 paper or the Introduction to the 2010 paper at SAS/IML and SAS/IML Studio Papers and Presentations Briefly, SAS/IML is the product that you license. It is also the name of a matrix language. PROC IML implements the matrix languiage on the SAS server. SAS/IML Studio is a development environment that enables SAS/IML programmers to develop SAS/IML programs. SAS/IML Studio runs on a Windows PC. It runs programs in IMLPlus, which is a language that includes SAS/IML syntax plus a Java-like syntax for creating dynamically linked graphics.

The SAMPLE function was introduced in SAS/IML 12.1 (See SAS/IML(R) 12.1 User's Guide). For SAS/IML 9.3, you can use a function from the book* Statistical Programming with SAS/IML Software*. See the links in the first paragraph of the article Sampling with replacement: Now easier than ever in the SAS/IML language - The DO Loop

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

Merci Rick! so, i wiill try to speak in english.

First, because of you, i have perfectly understood what IML is. However, i´ve tryed to follow the steps described in your topic about the sampling with and without remplacement by using the sample´s function and it doesn't work ,while it should be possible with sas 9.3

For example, i have this message in the log:

598 proc IML;

NOTE: IML Ready

599 x=1:5;

600 call randseed(325);

601 s_1=sample(x);

ERROR: Invocation of unresolved module SAMPLE.

statement : ASSIGN at line 601 column 1

602 print s_1;

ERROR: Matrix s_1 has not been set to a value.

statement : PRINT at line 602 column 1

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

I should have sent you the direct link to the SAS/IML 9.3 module for sampling with replacement: Sampling with replacement in SAS

Your program will look like this:

proc iml;

/* Define module for random sampling with replacement and uniform probability.

A is row vector with n elements and each sample contains k elements.

The result is an nSamples x k matrix. Each row contains one sample. */

start SampleReplaceUni(A, nSamples, k);

results = j(nSamples, k); /* allocate result matrix */

call randgen(results, "Uniform"); /* fill with random U(0,1) */

n = ncol(A); /* number of elements */

results = ceil(n*results); /* convert to integers 1,2,...n */

return(shape(A[results], nSamples)); /* reshape and return from A */

finish;

call randseed(1234);

/* Draw 5 elements with replacement from {1,2,...,8}; Repeat 10 times */

s = SampleReplaceUni(1:8, 10, 5);

print s;

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

MERCI BEAUCOUP!;)

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

Je vous en prie. Bonne chance.

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

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

Your version of SAS is now almost 3 years old. There have been three releases of SAS/IML software since then. If you want the newer features, I encourage you to upgrade your version of SAS.

To gain experience with SAS/IML programming, I recommend the book *Statistical Programming with SAS/IML Software.*

I do not have a module that does sampling without replacement that works for SAS/IML 9.3. You can use the SURVEYSELECT procedure in SAS/STAT, as shown in this article: Sample without replacement in SAS - The DO Loop

**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.

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.