SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10

How does one in SAS 9.4 generate the 20th percentile of a normal distribution with, say, a mean of 500 and standard deviation of 50? In R I call: qnorm(.20, 500, 50)

 

I have a bunch of percentiles of reading achievement scores, and I need to convert them to to scale scores.

 

I'm looking throughout the documentation and can't seem to find a way...unless I need to use PROC IML first, but I'm not very good with that.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Does the value of X look like what you want:

data junk;
   x = quantile('normal',.2,500,50);
run;

The SAS Quantile function takes as the first parameter the name of the distribution, there are about 25. Then the quantile of interest and then distribution parameters. If you leave off the mean and standard deviation the distribution for Normal will assume 0 and 1.

View solution in original post

3 REPLIES 3
ballardw
Super User

Does the value of X look like what you want:

data junk;
   x = quantile('normal',.2,500,50);
run;

The SAS Quantile function takes as the first parameter the name of the distribution, there are about 25. Then the quantile of interest and then distribution parameters. If you leave off the mean and standard deviation the distribution for Normal will assume 0 and 1.

svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
Nice! I read about that function, but did not get that I could implement it that way.
ballardw
Super User

@svh wrote:
Nice! I read about that function, but did not get that I could implement it that way.

Understand. Most of those other distributions really want one or more parameters and the examples using Normal in that function don't show the optional mean and std dev.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1189 views
  • 2 likes
  • 2 in conversation