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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 5446 views
  • 3 likes
  • 4 in conversation