BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi guys, I'd like to calculate percentile based on z-score. My data is massive where using z-score-percentile conversion table is futile. Please help? Below is first few observation of my data. Thanks!!!! 

 

data p.temp; 
input zcore;
cards;
0.16
3.1
-0.33
1.72
;

 

1 ACCEPTED SOLUTION
7 REPLIES 7
Cruise
Ammonite | Level 13

Thanks a lot @PaigeMiller.

 

data temp1; set temp;
pctl=probnorm(zcore);
run;

zcore  pctl

 

0.16    0.56

3.1      0.99

-0.33   0.37

1.7      0.96

 

Please correct me if I'm wrong. But it looks like it. I will double check with the conversion table as well.

Ksharp
Super User

Function PROBNORM() is too old ,Check CDF().

 

data temp; 
input zcore;
p=cdf('normal',zcore);
cards;
0.16
3.1
-0.33
1.72
;

proc print;run;
PaigeMiller
Diamond | Level 26

Too old? What risk does this pose to the user? The function is still supported by SAS, and the probabilities of a normal distribution haven't changed.

--
Paige Miller
Ksharp
Super User

It is better to explain by @Rick_SAS

FreelanceReinh
Jade | Level 19

Yes, there is a caveat regarding the "older" PROBXXX functions in Rick's Blog ("The DO Loop"). Just found it again: https://blogs.sas.com/content/iml/2013/07/10/stop-using-ranuni.html (at the bottom of the blog entry).

PaigeMiller
Diamond | Level 26

Thank you for the link, @FreelanceReinh. That's very interesting.

 

If I am understanding properly, the new functions will perform better when  you have very small or very large values, but in the range of –10 to +10, I just wrote a program and PROBNORM(x) and CDF('normal',x) give the same answers (at least to 14 decimal places).

 

In any event, SAS ought to update the PROBNORM (and similar functions) documentation to specifically say that users ought to use the newer CDF function, and state the reasons.

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 6301 views
  • 3 likes
  • 4 in conversation