BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nannà
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
IanWakeling
Barite | Level 11

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

View solution in original post

2 REPLIES 2
IanWakeling
Barite | Level 11

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

nannà
Calcite | Level 5

You are right.

There was an error in matrix b.

there wasn't a vector.

Thank you.

sas-innovate-2024.png

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.

 

Register now!

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.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 2 replies
  • 1160 views
  • 1 like
  • 2 in conversation