turn on suggestions

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

Showing results for

Find a Community

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-13-2014 01:56 PM

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

Accepted Solutions

Solution

03-13-2014
02:16 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ruther

03-13-2014 02:16 PM

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

All Replies

Solution

03-13-2014
02:16 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ruther

03-13-2014 02:16 PM

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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

03-14-2014 01:38 PM

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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ruther

03-14-2014 04:08 PM

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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

03-14-2014 04:28 PM

MERCI BEAUCOUP!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ruther

03-14-2014 04:35 PM

Je vous en prie. Bonne chance.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

03-15-2014 11:55 AM

Hello Rick. I have a last question. I'm starting with sas and i have no experience to do programs. What would the program be without remplacement?Thanks

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ruther

03-16-2014 08:23 AM

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