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

06-05-2012 12:46 PM

Hi, I want translate matlab code in sas.

Below the matlab code:

Y=loginv (P,mu,sigma)

where P is Probability vector.

I try whit proc iml.

Y= quantile('LOGNORMAL',b,&mu.,&sigma.)

but the resul is a singol number, I want a vector.

What do I do?

Accepted Solutions

Solution

06-06-2012
05:39 AM

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

Posted in reply to nannà

06-06-2012 05:39 AM

Are you sure that your matrix b is a vector? I tried the following and it seems to work for me.

proc iml;

p=do(0.50,0.95,0.05)`;

Y=quantile('LOGNORMAL',p,0,1);

print p Y;

quit;

this gives the following output:

0.5 1

0.55 1.1338981

0.6 1.2883304

0.65 1.4700854

0.7 1.6894457

0.75 1.9630311

0.8 2.3201254

0.85 2.8191443

0.9 3.6022245

0.95 5.1802516

All Replies

Solution

06-06-2012
05:39 AM

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

Posted in reply to nannà

06-06-2012 05:39 AM

Are you sure that your matrix b is a vector? I tried the following and it seems to work for me.

proc iml;

p=do(0.50,0.95,0.05)`;

Y=quantile('LOGNORMAL',p,0,1);

print p Y;

quit;

this gives the following output:

0.5 1

0.55 1.1338981

0.6 1.2883304

0.65 1.4700854

0.7 1.6894457

0.75 1.9630311

0.8 2.3201254

0.85 2.8191443

0.9 3.6022245

0.95 5.1802516

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

Posted in reply to IanWakeling

06-12-2012 11:36 AM

You are right.

There was an error in matrix b.

there wasn't a vector.

Thank you.